eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\MapLocationDistance::getFieldDefinitionIds PHP Method

getFieldDefinitionIds() protected method

Returns a list of IDs of searchable FieldDefinitions for the given criterion target.
protected getFieldDefinitionIds ( string $fieldIdentifier ) : array
$fieldIdentifier string
return array
    protected function getFieldDefinitionIds($fieldIdentifier)
    {
        $fieldDefinitionIdList = array();
        $fieldMap = $this->contentTypeHandler->getSearchableFieldMap();
        foreach ($fieldMap as $contentTypeIdentifier => $fieldIdentifierMap) {
            // First check if field exists in the current ContentType, there is nothing to do if it doesn't
            if (!(isset($fieldIdentifierMap[$fieldIdentifier]) && $fieldIdentifierMap[$fieldIdentifier]['field_type_identifier'] === 'ezgmaplocation')) {
                continue;
            }
            $fieldDefinitionIdList[] = $fieldIdentifierMap[$fieldIdentifier]['field_definition_id'];
        }
        if (empty($fieldDefinitionIdList)) {
            throw new InvalidArgumentException('$criterion->target', "No searchable fields found for the given criterion target '{$fieldIdentifier}'.");
        }
        return $fieldDefinitionIdList;
    }