protected function persistObject($object, $parentIdentifier)
    {
        if (isset($this->visitedDuringPersistence[$object])) {
            return $this->visitedDuringPersistence[$object];
        }

        $identifier = $this->persistenceSession->getIdentifierByObject($object);
        $this->visitedDuringPersistence[$object] = $identifier;

        $objectData = [];
        $objectState = $this->storeObject($object, $identifier, $parentIdentifier, $objectData);

        if ($this->reflectionService->getClassSchema($object)->getModelType() === ClassSchema::MODELTYPE_ENTITY) {
            $this->persistenceSession->registerReconstitutedEntity($object, $objectData);
        }
        $this->emitPersistedObject($object, $objectState);

        return $identifier;
    }
protected function persistObject($object, $parentIdentifier)
    {
        if (isset($this->visitedDuringPersistence[$object])) {
            return $this->visitedDuringPersistence[$object];
        }

        $identifier = $this->persistenceSession->getIdentifierByObject($object);
        $this->visitedDuringPersistence[$object] = $identifier;

        $objectData = [];
        $objectState = $this->storeObject($object, $identifier, $parentIdentifier, $objectData);

        if ($this->reflectionService->getClassSchema($object)->getModelType() === ClassSchema::MODELTYPE_ENTITY) {
            $this->persistenceSession->registerReconstitutedEntity($object, $objectData);
        }
        $this->emitPersistedObject($object, $objectState);

        return $identifier;
    }
protected function persistObject ( $ object , $ parentIdentifier ) { if ( isset ( $ this -> visitedDuringPersistence [ $ object ] ) ) { return $ this -> visitedDuringPersistence [ $ object ] ; } $ identifier = $ this -> persistenceSession -> getIdentifierByObject ( $ object ) ; $ this -> visitedDuringPersistence [ $ object ] = $ identifier ; $ objectData = [ ] ; $ objectState = $ this -> storeObject ( $ object , $ identifier , $ parentIdentifier , $ objectData ) ; if ( $ this -> reflectionService -> getClassSchema ( $ object ) -> getModelType ( ) === ClassSchema :: MODELTYPE_ENTITY ) { $ this -> persistenceSession -> registerReconstitutedEntity ( $ object , $ objectData ) ; } $ this -> emitPersistedObject ( $ object , $ objectState ) ; return $ identifier ; }
Stores or updates an object in the underlying storage.

@param object $object The object to persist
@param string $parentIdentifier
@return string
@api
Stores or updates an object in the underlying storage .