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 ModelToElasticaTransformerInterface
|
|
|
|
{
|
|
|
|
/**
|
2015-03-12 11:20:00 +01:00
|
|
|
* Transforms an object into an elastica object having the required keys.
|
2011-04-27 09:59:04 +02:00
|
|
|
*
|
|
|
|
* @param object $object the object to convert
|
2015-03-12 11:20:00 +01:00
|
|
|
* @param array $fields the keys we want to have in the returned array
|
|
|
|
*
|
2013-04-22 13:20:10 +02:00
|
|
|
* @return \Elastica\Document
|
2011-04-27 09:59:04 +02:00
|
|
|
**/
|
2015-03-12 11:20:00 +01:00
|
|
|
public function transform($object, array $fields);
|
2011-04-27 09:59:04 +02:00
|
|
|
}
|