FOSElasticaBundle/Transformer/ElasticaToModelTransformerInterface.php

36 lines
831 B
PHP
Raw Normal View History

<?php
namespace FOS\ElasticaBundle\Transformer;
/**
2015-03-12 11:20:00 +01:00
* Maps Elastica documents with model objects.
*/
interface ElasticaToModelTransformerInterface
{
/**
* Transforms an array of elastica objects into an array of
2015-03-12 11:20:00 +01:00
* model objects fetched from the doctrine repository.
*
* @param array $elasticaObjects array of elastica objects
2015-03-12 11:20:00 +01:00
*
* @return array of model objects
**/
2015-03-12 11:20:00 +01:00
public function transform(array $elasticaObjects);
2015-03-12 11:20:00 +01:00
public function hybridTransform(array $elasticaObjects);
2012-02-23 23:50:46 +01:00
/**
* Returns the object class used by the transformer.
*
* @return string
*/
2015-03-12 11:20:00 +01:00
public function getObjectClass();
/**
2015-03-12 11:20:00 +01:00
* Returns the identifier field from the options.
*
* @return string the identifier field
*/
2015-03-12 11:20:00 +01:00
public function getIdentifierField();
}