public function hydrate($model, array $fields = array())
    {
        if (is_array($model)) {
            return $this->getRepository($this->resolveModelClassName(reset($model)))->hydrate($model, $fields);
        }

        $row = $this->getRepository($this->resolveModelClassName($model))->hydrate(array($model), $fields);

        if (empty($row)) {
            return null;
        }

        return $row[0];
    }
public function hydrate($model, array $fields = array())
    {
        if (is_array($model)) {
            return $this->getRepository($this->resolveModelClassName(reset($model)))->hydrate($model, $fields);
        }

        $row = $this->getRepository($this->resolveModelClassName($model))->hydrate(array($model), $fields);

        if (empty($row)) {
            return null;
        }

        return $row[0];
    }
public function hydrate ( $ model , array $ fields = array ( ) ) { if ( is_array ( $ model ) ) { return $ this -> getRepository ( $ this -> resolveModelClassName ( reset ( $ model ) ) ) -> hydrate ( $ model , $ fields ) ; } $ row = $ this -> getRepository ( $ this -> resolveModelClassName ( $ model ) ) -> hydrate ( array ( $ model ) , $ fields ) ; if ( empty ( $ row ) ) { return null ; } return $ row [ 0 ] ; }
Hydrate a model.

@param mixed $model
@param array $fields List of fields prime (optional)

@return null|object|object[]
Hydrate a model .