src/GridFS/Hydrator.php
public function unhydrate($object)
    {
        $datas = parent::unhydrate($object);
        $properties = $this->classMetadata->getPropertiesInfos();
        foreach ($properties as $name => $infos) {
            if ($infos->getMetadata()) {
                if (isset($datas[$infos->getField()])) {
                    $datas["metadata"][$infos->getField()] = $datas[$infos->getField()];
                    unset($datas[$infos->getField()]);
                }
            }
        }
        return $datas;
    }
public function unhydrate($object)
    {
        $datas = parent::unhydrate($object);
        $properties = $this->classMetadata->getPropertiesInfos();
        foreach ($properties as $name => $infos) {
            if ($infos->getMetadata()) {
                if (isset($datas[$infos->getField()])) {
                    $datas["metadata"][$infos->getField()] = $datas[$infos->getField()];
                    unset($datas[$infos->getField()]);
                }
            }
        }
        return $datas;
    }
public function unhydrate ( $ object ) { $ datas = parent :: unhydrate ( $ object ) ; $ properties = $ this -> classMetadata -> getPropertiesInfos ( ) ; foreach ( $ properties as $ name => $ infos ) { if ( $ infos -> getMetadata ( ) ) { if ( isset ( $ datas [ $ infos -> getField ( ) ] ) ) { $ datas [ "metadata" ] [ $ infos -> getField ( ) ] = $ datas [ $ infos -> getField ( ) ] ; unset ( $ datas [ $ infos -> getField ( ) ] ) ; } } } return $ datas ; }
Unhydrate object to array

@param   mixed   $object     Object to unhydrate
@return  array
Unhydrate object to array