Gets the identifier of a document.

@param object $document

@return Identifier|null The identifier instance for the document
777055
public function getDocumentIdentifier($document)
    {
        return isset($this->documentIdentifiers[spl_object_hash($document)]) ?
            $this->documentIdentifiers[spl_object_hash($document)] : null;
    }
1204510
public function find($identifier)
    {
        $this->stringHelper->validate($identifier);

        foreach ($this->symbols as $symbol) {
            if (in_array($identifier, $symbol->getIdentifiers())) {
                return $symbol;
            }
        }

        return null;
    }
387571
public function retrieveByID($identifier)
	{
		$result = @ldap_read($this->conn, $identifier, '(objectclass=*)', $this->config['attributes']);
		if ($result === FALSE)
			return null;

		$entries = ldap_get_entries($this->conn, $result);
		if ($entries['count'] == 0 || $entries['count'] > 1)
			return null;

		return $this->clean($entries[0]);
	}
350639
public function getDefinition($identifier)
    {
        // Identifier is a php attribute
        if (isset($this->definitions[$identifier])) {
            return $this->definitions[$identifier];
        }

        // Identifier is a MongoDB Key
        if (isset($this->mongoIndex[$identifier])) {
            return $this->definitions[$this->mongoIndex[$identifier]];
        }

        return null;
    }
646782
public function hasDocument($document)
    {
        $oid = $this->getObjectIdentifier($document);

        return isset($this->documentMap[$oid]);
    }
901676
public function get($identifier = null)
    {
        $result = null;

        if (null === $identifier) {
            $result = self::$lookup;
        } elseif ('doozr.registry' === $identifier) {
            $result = $this;
        } else {
            if (true === isset(self::$lookup[$identifier])) {
                $result = self::$references[self::$lookup[$identifier]];
            }
        }

        return $result;
    }
797495
public static function getDocumentCompany($document)
    {
        return $document->getDataValue('firma') ? \FlexiPeeHP\FlexiBeeRO::uncode(
                $document->getDataValue('firma')) : null;
    }
1207145
public function getNormalizedIdentifier($document)
    {
        if (is_scalar($document)) {
            throw new \InvalidArgumentException('Invalid argument, object or null required');
        }

        // the document is not managed
        if (!$document || !$this->getDocumentManager()->contains($document)) {
            return;
        }

        $values = $this->getIdentifierValues($document);

        return $values[0];
    }
760458
public function getDocumentActualData($document)
    {
        $class      = $this->dm->getClassMetadata(get_class($document));
        $actualData = [];

        foreach ($class->propertyMetadata as $name => $mapping) {
            // skip not saved attributes
            if ($mapping->notSaved) {
                continue;
            }

            $value = $mapping->getValue($document);

            if ($mapping->isMany() && $value !== null && !($value instanceof PersistentCollectionInterface)) {
                // If $actualData[$name] is not a Collection then use an ArrayCollection.
                if (!$value instanceof Collection) {
                    $value = new ArrayCollection($value);
                }

                // Inject PersistentCollection
                $coll = $this->dm->getConfiguration()->getPersistentCollectionFactory()->create($this->dm, $mapping, $value);
                $coll->setOwner($document, $mapping);
                $coll->setDirty(!$value->isEmpty());
                $mapping->setValue($document, $coll);
                $actualData[$name] = $coll;
            } else {
                $actualData[$name] = $value;
            }
        }

        return $actualData;
    }
831214
public function getLocale($document)
    {
        if ($document instanceof LocaleBehavior) {
            return $document->getLocale();
        }

        if ($this->documentRegistry->hasDocument($document)) {
            return $this->documentRegistry->getLocaleForDocument($document);
        }

        return;
    }
1209295
public function insert($document): ?PostInsertId
    {
        /** @var DocumentMetadata $class */
        $class = $this->dm->getClassMetadata(get_class($document));
        $idGenerator = $this->dm->getUnitOfWork()->getIdGenerator($class->idGeneratorType);
        $postIdGenerator = $idGenerator->isPostInsertGenerator();

        $id = $postIdGenerator ? null : $class->getSingleIdentifier($document);
        $body = $this->prepareUpdateData($document)['body'];

        $response = $this->collection->create($id, $body);
        $data = $response->getData();

        foreach ($class->attributesMetadata as $field) {
            if (! $field instanceof FieldMetadata) {
                continue;
            }

            if ($field->indexName) {
                $field->setValue($document, $data['_index'] ?? null);
            }

            if ($field->typeName) {
                $field->setValue($document, $data['_type'] ?? null);
            }
        }

        $postInsertId = null;
        if ($postIdGenerator) {
            $postInsertId = new PostInsertId($document, $this->collection->getLastInsertedId());
        }

        return $postInsertId;
    }
1306778
protected function getDate(Document $document) 
	{
		if(null === $document->getDateEdit()) {
			return $document->getDateInsert()->format('Y-m-d H:i:s');
		}
		
		return $document->getDateEdit()->format('Y-m-d H:i:s');
	}
1315213
public function identifier($object): string
    {
        if (is_array($object) && isset($object['__identity'])) {
            return $object['__identity'];
        }
        if (is_string($object)) {
            return $object;
        }
        if (!is_object($object)) {
            return '';
        }
        return (string)$this->persistenceManager->getIdentifierByObject($object);
    }
191997
public function exists(object $document) : bool
    {
        $id = $this->class->getIdentifierObject($document);
        assert($this->collection instanceof Collection);
        return (bool) $this->collection->findOne(['_id' => $id], ['_id']);
    }
862830
public function exists($document)
    {
        $id = $this->class->getIdentifierObject($document);
        return (boolean) $this->collection->findOne(array('_id' => $id), array('_id'));
    }
1233455
public function findByIdentifier($identifier)
    {
        if (!isset($this->plugins[$identifier])) {
            $identifier = $this->normalizeIdentifier($identifier);
        }

        if (!isset($this->plugins[$identifier])) {
            return null;
        }

        return $this->plugins[$identifier];
    }
1088260
public function getObjectIdentity($object)
    {
        foreach ($this->configurations as $config) {
            if ($config->isRelevant($object)) {
                return $config->getObjectIdentity();
            }
        }

        return null;
    }