src/Transformer/ModelToElasticaIdentifierTransformer.php
public function transform($object, array $fields)
    {
        $identifier = $this->propertyAccessor->getValue($object, $this->options['identifier']);

        return new Document($identifier);
    }
public function transform($object, array $fields)
    {
        $identifier = $this->propertyAccessor->getValue($object, $this->options['identifier']);

        return new Document($identifier);
    }
Creates an elastica document with the id of the doctrine object as id.

@param object $object the object to convert
@param array  $fields the keys we want to have in the returned array

@return Document