public function load(ClassMetadata $class, $value, $options = array())
    {
        $client = $this->sm->getClient();

        if (isset($options['field'])) {
            $document = $client->findOneBy($class, $options['field'], $value);
        } else {
            $document = $client->find($class, $value, $options);
        }

        return $this->hydrateEntity($class, $document);
    }
public function load(ClassMetadata $class, $value, $options = array())
    {
        $client = $this->sm->getClient();

        if (isset($options['field'])) {
            $document = $client->findOneBy($class, $options['field'], $value);
        } else {
            $document = $client->find($class, $value, $options);
        }

        return $this->hydrateEntity($class, $document);
    }
public function load ( ClassMetadata $ class , $ value , $ options = array ( ) ) { $ client = $ this -> sm -> getClient ( ) ; if ( isset ( $ options [ 'field' ] ) ) { $ document = $ client -> findOneBy ( $ class , $ options [ 'field' ] , $ value ) ; } else { $ document = $ client -> find ( $ class , $ value , $ options ) ; } return $ this -> hydrateEntity ( $ class , $ document ) ; }
Load and hydrate a document model

@param ClassMetadata $class
@param mixed $value
@param array $options
Load and hydrate a document model