Move transformed finder and paginator out of the Doctrine\ namespace
This commit is contained in:
parent
cae2ebf20f
commit
743b2c0e64
|
@ -1,10 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FOQ\ElasticaBundle\Doctrine;
|
namespace FOQ\ElasticaBundle\Finder;
|
||||||
|
|
||||||
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
||||||
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
|
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
|
||||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||||
|
use FOQ\ElasticaBundle\Paginator\TransformedPaginatorAdapter;
|
||||||
use Zend\Paginator\Paginator;
|
use Zend\Paginator\Paginator;
|
||||||
use Elastica_Searchable;
|
use Elastica_Searchable;
|
||||||
use Elastica_Query;
|
use Elastica_Query;
|
||||||
|
@ -12,7 +13,7 @@ use Elastica_Query;
|
||||||
/**
|
/**
|
||||||
* Finds elastica documents and map them to persisted objects
|
* Finds elastica documents and map them to persisted objects
|
||||||
*/
|
*/
|
||||||
class Finder implements FinderInterface, PaginatedFinderInterface
|
class TransformedFinder implements FinderInterface, PaginatedFinderInterface
|
||||||
{
|
{
|
||||||
protected $searchable;
|
protected $searchable;
|
||||||
protected $transformer;
|
protected $transformer;
|
||||||
|
@ -55,10 +56,10 @@ class Finder implements FinderInterface, PaginatedFinderInterface
|
||||||
* Creates a paginator adapter for this query
|
* Creates a paginator adapter for this query
|
||||||
*
|
*
|
||||||
* @param Elastica_Query $query
|
* @param Elastica_Query $query
|
||||||
* @return DoctrinePaginatorAdapter
|
* @return TransformedPaginatorAdapter
|
||||||
*/
|
*/
|
||||||
protected function createPaginatorAdapter(Elastica_Query $query)
|
protected function createPaginatorAdapter(Elastica_Query $query)
|
||||||
{
|
{
|
||||||
return new PaginatorAdapter($this->searchable, $query, $this->transformer);
|
return new TransformedPaginatorAdapter($this->searchable, $query, $this->transformer);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace FOQ\ElasticaBundle\Doctrine;
|
namespace FOQ\ElasticaBundle\Paginator;
|
||||||
|
|
||||||
use FOQ\ElasticaBundle\Paginator\AbstractPaginatorAdapter;
|
|
||||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||||
use Elastica_Searchable;
|
use Elastica_Searchable;
|
||||||
use Elastica_Query;
|
use Elastica_Query;
|
||||||
|
@ -12,7 +11,7 @@ use Elastica_Query;
|
||||||
*
|
*
|
||||||
* Allows pagination of Elastica_Query
|
* Allows pagination of Elastica_Query
|
||||||
*/
|
*/
|
||||||
class PaginatorAdapter extends AbstractPaginatorAdapter
|
class TransformedPaginatorAdapter extends AbstractPaginatorAdapter
|
||||||
{
|
{
|
||||||
protected $transformer;
|
protected $transformer;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<argument /> <!-- mappings -->
|
<argument /> <!-- mappings -->
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="foq_elastica.finder.prototype" class="FOQ\ElasticaBundle\Doctrine\Finder" public="true" abstract="true">
|
<service id="foq_elastica.finder.prototype" class="FOQ\ElasticaBundle\Finder\TransformedFinder" public="true" abstract="true">
|
||||||
<argument /> <!-- index -->
|
<argument /> <!-- index -->
|
||||||
<argument /> <!-- transformer -->
|
<argument /> <!-- transformer -->
|
||||||
</service>
|
</service>
|
||||||
|
|
Loading…
Reference in a new issue