src/GridFS/Hydrator.php
public function hydrate(&$object, $datas, $soft = false, $maxReferenceDepth = 10)
    {
        $stream = $object->getStream();
        if (isset($datas['stream'])) {
            $stream = $datas['stream'];
            unset($datas['stream']);
        }

        if (isset($datas["metadata"])) {
            $metadata = $datas["metadata"];
            $datas = array_merge((array) $datas, (array) $metadata);
            unset($datas["metadata"]);
        }
        parent::hydrate($object, $datas, $soft, $maxReferenceDepth);

        if (isset($stream)) {
            $object->setStream($stream);
        }
    }
public function hydrate(&$object, $datas, $soft = false, $maxReferenceDepth = 10)
    {
        $stream = $object->getStream();
        if (isset($datas['stream'])) {
            $stream = $datas['stream'];
            unset($datas['stream']);
        }

        if (isset($datas["metadata"])) {
            $metadata = $datas["metadata"];
            $datas = array_merge((array) $datas, (array) $metadata);
            unset($datas["metadata"]);
        }
        parent::hydrate($object, $datas, $soft, $maxReferenceDepth);

        if (isset($stream)) {
            $object->setStream($stream);
        }
    }
public function hydrate ( & $ object , $ datas , $ soft = false , $ maxReferenceDepth = 10 ) { $ stream = $ object -> getStream ( ) ; if ( isset ( $ datas [ 'stream' ] ) ) { $ stream = $ datas [ 'stream' ] ; unset ( $ datas [ 'stream' ] ) ; } if ( isset ( $ datas [ "metadata" ] ) ) { $ metadata = $ datas [ "metadata" ] ; $ datas = array_merge ( ( array ) $ datas , ( array ) $ metadata ) ; unset ( $ datas [ "metadata" ] ) ; } parent :: hydrate ( $ object , $ datas , $ soft , $ maxReferenceDepth ) ; if ( isset ( $ stream ) ) { $ object -> setStream ( $ stream ) ; } }
Hydrate an object from data

@param   mixed   $object         Object to hydrate
@param   mixed   $datas          Data to hydrate object
@param   integer $maxReference   Depth Maximum reference depth
@return  void
Hydrate an object from data