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

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

        return isset($this->objects[$oid]) || isset($this->objects[$id]);
    }
public function hasObject ( $ object ) { $ oid = spl_object_hash ( $ object ) ; if ( ! isset ( $ this -> objectsRepository [ $ oid ] ) ) { return false ; } $ repository = $ this -> objectsRepository [ $ oid ] ; $ data = $ repository -> getHydrator ( ) -> unhydrate ( $ object ) ; $ id = isset ( $ data [ '_id' ] ) ? serialize ( $ data [ '_id' ] ) . $ repository -> getCollection ( ) : $ oid ; return isset ( $ this -> objects [ $ oid ] ) || isset ( $ this -> objects [ $ id ] ) ; }
Check if object is managed

@param   mixed   $object     Object to search
@return  boolean
Check if object is managed