src/ObjectManager.php
public function addObject($object, $state, $repository)
    {
        $data = $repository->getHydrator()->unhydrate($object);
        $oid = spl_object_hash($object);
        $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;

        if (!isset($this->objectStates[$id])) {
            $this->objectStates[$id] = $state;
        }
        $this->objects[$id] = $object;
        $this->objectsRepository[$oid] = $repository;
    }
public function addObject($object, $state, $repository)
    {
        $data = $repository->getHydrator()->unhydrate($object);
        $oid = spl_object_hash($object);
        $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;

        if (!isset($this->objectStates[$id])) {
            $this->objectStates[$id] = $state;
        }
        $this->objects[$id] = $object;
        $this->objectsRepository[$oid] = $repository;
    }
public function addObject ( $ object , $ state , $ repository ) { $ data = $ repository -> getHydrator ( ) -> unhydrate ( $ object ) ; $ oid = spl_object_hash ( $ object ) ; $ id = isset ( $ data [ '_id' ] ) ? serialize ( $ data [ '_id' ] ) . $ repository -> getCollection ( ) : $ oid ; if ( ! isset ( $ this -> objectStates [ $ id ] ) ) { $ this -> objectStates [ $ id ] = $ state ; } $ this -> objects [ $ id ] = $ object ; $ this -> objectsRepository [ $ oid ] = $ repository ; }
Add an object

@param   mixed   $object     Object to add
@param   int     $state      State of this object
@return  void
Add an object