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);
    }