@param MetaInformationInterface $metaInformation

@return null|Document

@throws SolrMappingException if no id is set
340893
public function createDocument(MetaInformationInterface $metaInformation)
    {
        $fields = $metaInformation->getFields();
        if (count($fields) == 0) {
            return null;
        }

        if (!$metaInformation->getEntityId() && !$metaInformation->generateDocumentId()) {
            throw new SolrMappingException(sprintf('No entity id set for "%s"', $metaInformation->getClassName()));
        }

        $documentId = $metaInformation->getDocumentKey();
        if ($metaInformation->generateDocumentId()) {
            $documentId = $metaInformation->getDocumentName() . '_' . Uuid::uuid1()->toString();
        }

        $document = new Document();
        $document->setKey(MetaInformationInterface::DOCUMENT_KEY_FIELD_NAME, $documentId);

        $document->setBoost($metaInformation->getBoost());

        foreach ($fields as $field) {
            if (!$field instanceof Field) {
                continue;
            }

            $fieldValue = $field->getValue();
            if (($fieldValue instanceof Collection || is_array($fieldValue)) && $field->nestedClass) {
                $this->mapCollectionField($document, $field, $metaInformation->getEntity());
            } else if (is_object($fieldValue) && $field->nestedClass) { // index sinsgle object as nested child-document
                $document->addField('_childDocuments_', [$this->objectToDocument($fieldValue)], $field->getBoost());
            } else if (is_object($fieldValue) && !$field->nestedClass) { // index object as "flat" string, call getter
                $document->addField($field->getNameWithAlias(), $this->mapObjectField($field), $field->getBoost());
            } else if ($field->getter && $fieldValue) { // call getter to transform data (json to array, etc.)
                $getterValue = $this->callGetterMethod($metaInformation->getEntity(), $field->getGetterName());
                $document->addField($field->getNameWithAlias(), $getterValue, $field->getBoost());
            } else { // field contains simple data-type
                $document->addField($field->getNameWithAlias(), $fieldValue, $field->getBoost());
            }

            if ($field->getFieldModifier()) {
                $document->setFieldModifier($field->getNameWithAlias(), $field->getFieldModifier());
            }
        }

        return $document;
    }
613580
public function setInvoiceMetadata(\AgentSIB\Diadoc\Api\Proto\Documents\InvoiceDocument\InvoiceMetadata $value = null)
    {
        $this->InvoiceMetadata = $value;
    }
410511
protected function getAuthorizationInfo(IdentityInterface $identity): AuthorizationInfoInterface
    {
        foreach ($this->getRealms() as $realm) {
            $info = $realm->getAuthorizationInfo($identity);
            if ($info instanceof AuthorizationInfoInterface) {
                return $info;
            }
        }

        return new AuthorizationInfo();
    }
595265
public function generate($document, ClassMetadata $class, DocumentManagerInterface $dm, $parent = null)
    {
        if (null === $parent) {
            $parent = $class->parentMapping ? $class->getFieldValue($document, $class->parentMapping) : null;
        }
        $repository = $dm->getRepository($class->name);
        if (!($repository instanceof RepositoryIdInterface)) {
            throw new IdException("ID could not be determined. Make sure the that the Repository '".ClassUtils::getClass($repository)."' implements RepositoryIdInterface");
        }

        $id = $repository->generateId($document, $parent);
        if (!$id) {
            throw new IdException('ID could not be determined. Repository was unable to generate an ID');
        }

        return $id;
    }
113861
public function storeMeta($metaData, $metaType, $metaId, $metaModel = Meta::class)
    {
        // Validation required instead of type hinting because it could be passed as false or NULL
        if (!is_array($metaData)) {
            return;
        }

        foreach ($metaData as $key => $value) {
            $modelInstance = call_user_func(
                [$metaModel, 'firstOrNew'],
                [
                    'key'       => $key,
                    'meta_type' => $metaType,
                    'meta_id'   => $metaId,
                ]
            );

            $value = $this->removeEmptyValues($value);
            if (!empty($value)) {
                $modelInstance->setAttribute('value', $value);
                $modelInstance->save();
                continue;
            }

            // The value is empty, remove the row
            if ($modelInstance->exists) {
                $modelInstance->delete();
            }
        }
    }
596243
public function add(MetaSetInterface $metaSet)
    {
        $this->metaSets[$metaSet->getId()] = $metaSet;
        $this->nameMap[$metaSet->getName()] = $metaSet->getId();

        return $this;
    }
189555
public function get_mapping_attribute( $metakey ) {
		$mapping = array_flip( $this->get_mapping() );

		return isset( $mapping[ $metakey ] ) ? $mapping[ $metakey ] : null;
	}
1188238
public static function fromEntity(FieldMetadata $meta, $entity) {
        $instance = new static($meta, $entity->getAttribute($meta->name));

        return $instance;
    }
349652
function getMeta($metaKey = null)
    {
        if ($metaKey !== null)
            return (isset($this->meta[$metaKey])) ? $this->meta[$metaKey] : null;

        return $this->meta;
    }
514047
function meta()
    {
        if (!$this->_rMetaInfo)
            $this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());

        return $this->_rMetaInfo;
    }
1082555
protected function hasChanged($doctrineChangeSet, $entity)
    {
        if (empty($doctrineChangeSet)) {
            return false;
        }

        $metaInformation = $this->metaInformationFactory->loadInformation($entity);

        $documentChangeSet = array();

        /* Check all Solr fields on this entity and check if this field is in the change set */
        foreach ($metaInformation->getFields() as $field) {
            if (array_key_exists($field->name, $doctrineChangeSet)) {
                $documentChangeSet[] = $field->name;
            }
        }

        return count($documentChangeSet) > 0;
    }
1184390
public static function metaForTemplateEntity(
        ClassMetadataBuilder $builder
    ): void {
        $manyToOne = $builder->createManyToOne(
            TemplateEntity::getDoctrineStaticMeta()->getSingular(),
            TemplateEntity::class
        );
        $manyToOne
            ->inversedBy(self::getDoctrineStaticMeta()->getPlural())
            ->addJoinColumn(
                Inflector::tableize(
                    TemplateEntity::getDoctrineStaticMeta()->getSingular()
                ) . '_' . IdFieldInterface::PROP_ID,
                IdFieldInterface::PROP_ID,
                true
            )->build();

    }
1023568
public function generate($document, ClassMetadata $cm, DocumentManagerInterface $dm, $parent = null)
    {
        $id = $cm->getFieldValue($document, $cm->identifier);
        if (!$id) {
            throw new IdException('ID could not be read from the document instance using the AssignedIdGenerator.');
        }

        return $id;
    }
255319
public function getActionRequestMeta($action, Entity $entity = NULL, $method = \Psc\Net\HTTP\Request::GET) {
    if (!array_key_exists($action, $this->actionsRequestMeta)) {
      $idIsInt = ($identifierType = $this->getIdentifier()->getType()) instanceof IntegerType;
      $this->actionsRequestMeta[$action] = new RequestMeta($method,
                                               $this->constructUrl(array($this->getEntityName(), ($idIsInt ? '%d' : '%s'), $action)),
                                               array($identifierType)
                                              );
    }
    
    if (isset($entity)) {
      $meta = clone $this->actionsRequestMeta[$action];
      return $meta->setInput($entity->getIdentifier());
    } else {
      return $this->actionsRequestMeta[$action];
    }
  }
1330895
private function getMetaData( ezcCacheStackMetaDataStorage $metaStorage )
    {
        $metaData = $metaStorage->restoreMetaData();
        
        if ( $metaData === null )
        {
            $metaData = call_user_func(
                array(
                    $this->properties['options']->replacementStrategy,
                    'createMetaData'
                )
            );
        }

        return $metaData;
    }
400046
protected function getModelRepositoryForInformation(ModelInformationInterface $information)
    {
        /** @var ModelRepositoryFactoryInterface $factory */
        $factory = app(ModelRepositoryFactoryInterface::class);

        $modelRepository = $factory->make($information->modelClass());

        $this->applyRepositoryContext($modelRepository, $information);

        return $modelRepository;
    }
651671
private function addWhereSecurityIdentitiesForSharing(GetFilterEvent $event, ClassMetadata $meta)
    {
        $where = '';
        $mapSids = (array) $event->getRealParameter('map_security_identities');
        $mapSids = !empty($mapSids) ? $mapSids : ['_without_security_identity' => 'null'];
        $connection = $event->getConnection();

        foreach ($mapSids as $type => $stringIds) {
            $where .= '' === $where ? '' : ' OR ';
            $where .= sprintf(
                '(s.%s = %s AND s.%s IN (%s))',
                $meta->getColumnName('identityClass'),
                $connection->quote($type),
                $meta->getColumnName('identityName'),
                $stringIds
            );
        }

        return $where;
    }