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;
    }