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

            if (isset($this->objectStates[$id])) {
                return $this->objectStates[$id];
            }
        }

        return null;
    }
public function getObjectState($object)
    {
        $oid = spl_object_hash($object);
        if (isset($this->objectsRepository[$oid])) {
            $repository = $this->objectsRepository[$oid];
            $data = $repository->getHydrator()->unhydrate($object);
            $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;

            if (isset($this->objectStates[$id])) {
                return $this->objectStates[$id];
            }
        }

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

@param   mixed   $object
@return  void
Get object state