@param array $grep_fields
@param bool  $includeBusiness

@return \caption_field[]
493958
public function get_fields(array $grep_fields = null, $includeBusiness = false)
    {
        $fields = [];

        foreach ($this->retrieve_fields() as $meta_struct_id => $field) {
            if ($grep_fields && ! in_array($field->get_name(), $grep_fields, true)) {
                continue;
            }

            if ((!$includeBusiness) && $field->get_databox_field()->isBusiness() === true) {
                continue;
            }

            $fields[] = $field;
        }

        return $fields;
    }
1094581
protected function parseIncludes(array $includes)
    {
        $return = [
            'includes' => [],
            'modes' => []
        ];

        foreach ($includes as $include) {
            $explode = explode(':', $include);

            if (!isset($explode[1])) {
                $explode[1] = $this->defaults['mode'];
            }

            $return['includes'][] = $explode[0];
            $return['modes'][$explode[0]] = $explode[1];
        }

        return $return;
    }
770969
private function otherFields(array $fields): array
    {
        $unused = array_diff(self::OTHER_ADVANCED_FIELDS, array_keys($fields));

        $other_fileds = [];

        foreach ($unused as $tag) {
            $other_fileds[$tag] = GedcomTag::getLabel($tag);
        }

        return $other_fileds;
    }
1241132
public function findCompanyBusinessUnitStoresByCompanyBusinessUnitId(int $companyBusinessUnitId): array
    {
        $companyBusinessUnitStoreEntities = $this->getFactory()
            ->createFosCompanyBusinessUnitStoreQuery()
            ->findByFkCompanyBusinessUnit($companyBusinessUnitId);

        if (empty($companyBusinessUnitStoreEntities)) {
            return [];
        }

        $stores = [];
        foreach ($companyBusinessUnitStoreEntities as $companyBusinessUnitStoreEntity) {
            $stores[] = (new CompanyBusinessUnitStoreTransfer())->fromArray($companyBusinessUnitStoreEntity->toArray());
        }

        return $stores;
    }
773611
function getIncludesArray (query) {
  var relationships = query.include.split(',')

  return relationships.map(function (val) {
    return val.trim()
  })
}
51867
public function addAllFieldsExcept($exclusions, $includeHasOne = false)
    {
        if (!is_array($exclusions)) {
            $exclusions = [$exclusions];
        }
        $fields = $this->allFieldsFromDataObject($includeHasOne);
        $filteredFields = array_diff($fields, $exclusions);

        return $this->addFields($filteredFields);
    }
338925
public function MetaTags($includeTitle = true)
    {
        $tags = [];
        $tagsArray = $this->MetaComponents();
        if (!$includeTitle || strtolower($includeTitle) == 'false') {
            unset($tagsArray['title']);
        }

        foreach ($tagsArray as $tagProps) {
            $tag = array_merge([
                'tag' => 'meta',
                'attributes' => [],
                'content' => null,
            ], $tagProps);
            $tags[] = HTML::createTag($tag['tag'], $tag['attributes'], $tag['content']);
        }

        $tagString = implode("\n", $tags);
        if ($this->ExtraMeta) {
            $tagString .= $this->obj('ExtraMeta')->forTemplate();
        }

        $this->extend('MetaTags', $tagString);

        return $tagString;
    }
548834
protected function fetchLinkableNodes ($output, $includeImages = false)
    {
        $crawler = $this->getCrawler($output);
        $filter  = 'link, script[src]';

        if ( $includeImages ) {
            $filter .= ', img[src]';
        }

        return new Collection($crawler->filter($filter)->extract([ 'src', 'href' ]));
    }
594847
public static function select($arr, $includedKeys)
    {
        $ret = [];
        foreach ($includedKeys as $key) {
            if (array_key_exists($key, $arr)) {
                $ret[$key] = $arr[$key];
            }
        }
        return $ret;
    }
927562
def _IncludeFields(encoded_message, message, include_fields):
    """"""
    if include_fields is None:
        return encoded_message
    result = json.loads(encoded_message)
    for field_name in include_fields:
        try:
            value = _GetField(message, field_name.split('.'))
            nullvalue = None
            if isinstance(value, list):
                nullvalue = []
        except KeyError:
            raise exceptions.InvalidDataError(
                'No field named %s in message of type %s' % (
                    field_name, type(message)))
        _SetField(result, field_name.split('.'), nullvalue)
    return json.dumps(result)
13544
public function toArray($includeMetaData = false, $nestedInclude = true, $callback = null)
	{
		$data = $this->transformToArray($this->data, $nestedInclude, [], $callback);
		
		if( ! $includeMetaData )
		{
			return $data;
		}

		$result = [];
		$result['data'] = $data;
		
		if( ! empty($this->included) && ! $nestedInclude && $includeMetaData)
		{
			$result['included'] = $this->transformToArray($this->getIncludes(), false, [], $callback);
		}

		if( $includeMetaData && ! empty($this->meta) )
		{
			$result['meta'] = $this->meta;
		}

		

		return $result;
	}
1040338
public static function getAllIdentifiers(bool $includeObsolete = false) : array
    {
        return \DateTimeZone::listIdentifiers(
            $includeObsolete
            ? \DateTimeZone::ALL_WITH_BC
            : \DateTimeZone::ALL
        );
    }
525859
public function getFields(bool $filter = true): array
    {
        $result = [];
        foreach ($this->fields as $name => $field) {
            $result[$name] = $this->getField($name, null, $filter);
        }

        return $result;
    }
1154320
public function listLog($level = Logger::LOG_LEVEL_ALL, $includeContext = true, $time = 0)
    {
        $list = $this->logFile->listLog($level, $time);
        $result = [];
        foreach ($list as $entry) {
            if (isset($entry['dumpfile'])) {

                if ($includeContext) {
                    /** @var DumpFile $dumpFile */
                    $dumpFile = $entry['dumpfile'];

                    $entry['context'] = $dumpFile->getUnSerializedContent()[0];
                }


                unset($entry['dumpfile']);

            }
            $result[] = $entry;

        }

        return $result;
    }
875856
public function getOrganizations($includeGroups = true)
    {
        $organizations = [];

        if ($includeGroups) {
            foreach ($this->groups as $group) {
                array_merge($organizations, $group->getOrganizations()->toArray());
            }
        }

        $userOrgas = $this->userOrganizationReferences->toArray();
        $userOrgas = array_map(function ($ref) {
            return $ref->getOrganization();
        }, $userOrgas);

        return array_merge($organizations, $userOrgas);
    }
1250335
protected function getDocumentAsArray(SearchResult $document, $additionalTopResultsFields = []) : array
    {
        $fields = [
            'link' => $document->getUrl(),
            'type' => $document['type_stringS'] ? $document['type_stringS'] : $document->getType(),
            'title' => $document->getTitle(),
            'content' => $document->getContent(),
            'group' => $document->getHasGroupItem() ? $document->getGroupItem()->getGroupValue() : '',
            'previewImage' => $document['previewImage_stringS'] ? $document['previewImage_stringS'] : '',
        ];
        foreach ($additionalTopResultsFields as $additionalTopResultsField) {
            $fields[$additionalTopResultsField] = $document[$additionalTopResultsField] ? $document[$additionalTopResultsField] : '';
        }
        return $fields;
    }
1218154
public function getGroupByString($includeText = true)
    {
        $statement = "";

        foreach ($this->groupBy as $groupBy) {
            $statement .= $groupBy['column'];

            if ($groupBy['order']) {
                $statement .= " " . $groupBy['order'];
            }

            $statement .= ", ";
        }

        $statement = substr($statement, 0, -2);

        if ($includeText && $statement) {
            $statement = "GROUP BY " . $statement;
        }

        return $statement;
    }