protected function get_group_values( Field_Contract $group, $data ) {
		if ( ! $group->is_group() || ! $group->get_option( 'fields' ) ) {
			return null;
		}

		if ( ! is_array( $data ) ) {
			return null;
		}

		// We will working on clone of the $group, to prevent touching
		// on real object.
		$group = clone $group;

		$i = 0;
		$values = [];

		foreach ( array_values( $data ) as $_data ) {
			if ( ! is_array( $_data ) || empty( $_data ) ) {
				continue;
			}

			$group->index = $i;

			$fields = array_map( function ( $args ) use ( $group ) {
				return $this->config->get_field_in_group( $group, $args['id'] );
			}, $group->get_option( 'fields' ) );

			$values[ $i ] = Utils::filter_blank(
				$this->prepare_submitted_data( $fields, $_data, true )
			);

			$i++;
		}

		return array_filter( $values );
	}
protected function get_group_values( Field_Contract $group, $data ) {
		if ( ! $group->is_group() || ! $group->get_option( 'fields' ) ) {
			return null;
		}

		if ( ! is_array( $data ) ) {
			return null;
		}

		// We will working on clone of the $group, to prevent touching
		// on real object.
		$group = clone $group;

		$i = 0;
		$values = [];

		foreach ( array_values( $data ) as $_data ) {
			if ( ! is_array( $_data ) || empty( $_data ) ) {
				continue;
			}

			$group->index = $i;

			$fields = array_map( function ( $args ) use ( $group ) {
				return $this->config->get_field_in_group( $group, $args['id'] );
			}, $group->get_option( 'fields' ) );

			$values[ $i ] = Utils::filter_blank(
				$this->prepare_submitted_data( $fields, $_data, true )
			);

			$i++;
		}

		return array_filter( $values );
	}
protected function get_group_values ( Field_Contract $ group , $ data ) { if ( ! $ group -> is_group ( ) || ! $ group -> get_option ( 'fields' ) ) { return null ; } if ( ! is_array ( $ data ) ) { return null ; } // We will working on clone of the $group, to prevent touching // on real object. $ group = clone $ group ; $ i = 0 ; $ values = [ ] ; foreach ( array_values ( $ data ) as $ _data ) { if ( ! is_array ( $ _data ) || empty ( $ _data ) ) { continue ; } $ group -> index = $ i ; $ fields = array_map ( function ( $ args ) use ( $ group ) { return $ this -> config -> get_field_in_group ( $ group , $ args [ 'id' ] ) ; } , $ group -> get_option ( 'fields' ) ) ; $ values [ $ i ] = Utils :: filter_blank ( $ this -> prepare_submitted_data ( $ fields , $ _data , true ) ) ; $ i ++ ; } return array_filter ( $ values ) ; }
Gets values of a group with given data.

@param  Field_Contract $group
@param  array          $data
@return array|null
Gets values of a group with given data .