protected function createDocument($class, \stdClass $orientObject)
    {
        $metadata = $this->getMetadataFactory()->getMetadataFor($class);

        /**
         * when a record from OrientDB doesn't have a RID
         * it means it's an embedded object, which can not be
         * lazily loaded.
         */
        if (isset($orientObject->{'@rid'})) {
            $rid = new Rid($orientObject->{'@rid'});
            if ($this->getUnitOfWork()->hasProxyFor($rid)) {
                $document = $this->getUnitOfWork()->getProxyFor($rid);
            } else {
                $document = $this->getProxyFactory()->getProxy($class, array($metadata->getRidPropertyName() => $rid->getValue()));
            }
        } else {
            $class = $metadata->getName();
            $document = new $class;
        }

        $this->fill($document, $orientObject);

        return $document;
    }
protected function createDocument($class, \stdClass $orientObject)
    {
        $metadata = $this->getMetadataFactory()->getMetadataFor($class);

        /**
         * when a record from OrientDB doesn't have a RID
         * it means it's an embedded object, which can not be
         * lazily loaded.
         */
        if (isset($orientObject->{'@rid'})) {
            $rid = new Rid($orientObject->{'@rid'});
            if ($this->getUnitOfWork()->hasProxyFor($rid)) {
                $document = $this->getUnitOfWork()->getProxyFor($rid);
            } else {
                $document = $this->getProxyFactory()->getProxy($class, array($metadata->getRidPropertyName() => $rid->getValue()));
            }
        } else {
            $class = $metadata->getName();
            $document = new $class;
        }

        $this->fill($document, $orientObject);

        return $document;
    }
protected function createDocument ( $ class , \ stdClass $ orientObject ) { $ metadata = $ this -> getMetadataFactory ( ) -> getMetadataFor ( $ class ) ; /**
         * when a record from OrientDB doesn't have a RID
         * it means it's an embedded object, which can not be
         * lazily loaded.
         */ if ( isset ( $ orientObject -> { '@rid' } ) ) { $ rid = new Rid ( $ orientObject -> { '@rid' } ) ; if ( $ this -> getUnitOfWork ( ) -> hasProxyFor ( $ rid ) ) { $ document = $ this -> getUnitOfWork ( ) -> getProxyFor ( $ rid ) ; } else { $ document = $ this -> getProxyFactory ( ) -> getProxy ( $ class , array ( $ metadata -> getRidPropertyName ( ) => $ rid -> getValue ( ) ) ) ; } } else { $ class = $ metadata -> getName ( ) ; $ document = new $ class ; } $ this -> fill ( $ document , $ orientObject ) ; return $ document ; }
Either tries to get the proxy


@param  string      $class
@param  \stdClass   $orientObject
@return object of type $class
Either tries to get the proxy