protected function fill($document, \stdClass $object)
    {
        $metadata = $this->getMetadataFactory()->getMetadataFor(get_class($document));
        $propertyAnnotations = $this->getMetadataFactory()->getObjectPropertyAnnotations($document);

        foreach ($propertyAnnotations as $property => $annotation) {
            $documentProperty = $property;

            if ($annotation->name) {
                $property = $annotation->name;
            }

            if (property_exists($object, $property)) {
                $value = $this->hydrateValue($object->$property, $annotation);
                $metadata->setDocumentValue($document, $documentProperty, $value);
            }
        }

        if ($document instanceof Proxy) {
            $document->__setInitialized(true);
        }

        return $document;
    }
protected function fill($document, \stdClass $object)
    {
        $metadata = $this->getMetadataFactory()->getMetadataFor(get_class($document));
        $propertyAnnotations = $this->getMetadataFactory()->getObjectPropertyAnnotations($document);

        foreach ($propertyAnnotations as $property => $annotation) {
            $documentProperty = $property;

            if ($annotation->name) {
                $property = $annotation->name;
            }

            if (property_exists($object, $property)) {
                $value = $this->hydrateValue($object->$property, $annotation);
                $metadata->setDocumentValue($document, $documentProperty, $value);
            }
        }

        if ($document instanceof Proxy) {
            $document->__setInitialized(true);
        }

        return $document;
    }
protected function fill ( $ document , \ stdClass $ object ) { $ metadata = $ this -> getMetadataFactory ( ) -> getMetadataFor ( get_class ( $ document ) ) ; $ propertyAnnotations = $ this -> getMetadataFactory ( ) -> getObjectPropertyAnnotations ( $ document ) ; foreach ( $ propertyAnnotations as $ property => $ annotation ) { $ documentProperty = $ property ; if ( $ annotation -> name ) { $ property = $ annotation -> name ; } if ( property_exists ( $ object , $ property ) ) { $ value = $ this -> hydrateValue ( $ object -> $ property , $ annotation ) ; $ metadata -> setDocumentValue ( $ document , $ documentProperty , $ value ) ; } } if ( $ document instanceof Proxy ) { $ document -> __setInitialized ( true ) ; } return $ document ; }
Given an object and an Orient-object, it fills the former with the
latter.

@param  object      $document
@param  \stdClass   $object
@return object
Given an object and an Orient - object it fills the former with the latter .