2011-04-27 09:59:04 +02:00
|
|
|
<?php
|
|
|
|
|
2013-03-27 18:44:06 +01:00
|
|
|
namespace FOS\ElasticaBundle\Transformer;
|
2011-04-27 09:59:04 +02:00
|
|
|
|
|
|
|
/**
|
2015-03-12 11:20:00 +01:00
|
|
|
* Maps Elastica documents with model objects.
|
2011-04-27 09:59:04 +02:00
|
|
|
*/
|
|
|
|
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.
|
2011-04-27 09:59:04 +02:00
|
|
|
*
|
2013-03-02 12:23:44 +01:00
|
|
|
* @param array $elasticaObjects array of elastica objects
|
2015-03-12 11:20:00 +01:00
|
|
|
*
|
2011-04-27 09:59:04 +02:00
|
|
|
* @return array of model objects
|
|
|
|
**/
|
2015-03-12 11:20:00 +01:00
|
|
|
public function transform(array $elasticaObjects);
|
2012-01-03 23:16:56 +01:00
|
|
|
|
2015-03-12 11:20:00 +01:00
|
|
|
public function hybridTransform(array $elasticaObjects);
|
2012-02-23 23:50:46 +01:00
|
|
|
|
2012-01-03 23:16:56 +01:00
|
|
|
/**
|
|
|
|
* Returns the object class used by the transformer.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2015-03-12 11:20:00 +01:00
|
|
|
public function getObjectClass();
|
2012-09-25 00:15:05 +02:00
|
|
|
|
|
|
|
/**
|
2015-03-12 11:20:00 +01:00
|
|
|
* Returns the identifier field from the options.
|
2012-09-25 00:15:05 +02:00
|
|
|
*
|
|
|
|
* @return string the identifier field
|
|
|
|
*/
|
2015-03-12 11:20:00 +01:00
|
|
|
public function getIdentifierField();
|
2011-04-27 09:59:04 +02:00
|
|
|
}
|