Move transformed finder and paginator out of the Doctrine\ namespace

This commit is contained in:
ornicar 2011-05-09 17:52:06 -07:00
parent cae2ebf20f
commit 743b2c0e64
3 changed files with 8 additions and 8 deletions

View file

@ -1,10 +1,11 @@
<?php
namespace FOQ\ElasticaBundle\Doctrine;
namespace FOQ\ElasticaBundle\Finder;
use FOQ\ElasticaBundle\Finder\FinderInterface;
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use FOQ\ElasticaBundle\Paginator\TransformedPaginatorAdapter;
use Zend\Paginator\Paginator;
use Elastica_Searchable;
use Elastica_Query;
@ -12,7 +13,7 @@ use Elastica_Query;
/**
* Finds elastica documents and map them to persisted objects
*/
class Finder implements FinderInterface, PaginatedFinderInterface
class TransformedFinder implements FinderInterface, PaginatedFinderInterface
{
protected $searchable;
protected $transformer;
@ -55,10 +56,10 @@ class Finder implements FinderInterface, PaginatedFinderInterface
* Creates a paginator adapter for this query
*
* @param Elastica_Query $query
* @return DoctrinePaginatorAdapter
* @return TransformedPaginatorAdapter
*/
protected function createPaginatorAdapter(Elastica_Query $query)
{
return new PaginatorAdapter($this->searchable, $query, $this->transformer);
return new TransformedPaginatorAdapter($this->searchable, $query, $this->transformer);
}
}

View file

@ -1,8 +1,7 @@
<?php
namespace FOQ\ElasticaBundle\Doctrine;
namespace FOQ\ElasticaBundle\Paginator;
use FOQ\ElasticaBundle\Paginator\AbstractPaginatorAdapter;
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use Elastica_Searchable;
use Elastica_Query;
@ -12,7 +11,7 @@ use Elastica_Query;
*
* Allows pagination of Elastica_Query
*/
class PaginatorAdapter extends AbstractPaginatorAdapter
class TransformedPaginatorAdapter extends AbstractPaginatorAdapter
{
protected $transformer;

View file

@ -30,7 +30,7 @@
<argument /> <!-- mappings -->
</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 /> <!-- transformer -->
</service>