FOSElasticaBundle/Transformer/ModelToElasticaTransformerInterface.php

20 lines
480 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 ModelToElasticaTransformerInterface
{
/**
2015-03-12 11:20:00 +01:00
* Transforms an object into an elastica object having the required keys.
*
* @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
*
* @return \Elastica\Document
**/
2015-03-12 11:20:00 +01:00
public function transform($object, array $fields);
}