Added RepositoryManagerInterface
This commit is contained in:
parent
98536d3f29
commit
a6e8d0a31c
2 changed files with 39 additions and 2 deletions
36
Manager/RepositoryManagerInterface.php
Normal file
36
Manager/RepositoryManagerInterface.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Manager;
|
||||
|
||||
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
*
|
||||
* Allows retrieval of basic or custom repository for mapped Doctrine
|
||||
* entities/documents.
|
||||
*/
|
||||
interface RepositoryManagerInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Adds entity name and its finder.
|
||||
* Custom repository class name can also be added.
|
||||
*
|
||||
* @param string $entityName
|
||||
* @param $finder
|
||||
* @param string $repositoryName
|
||||
*/
|
||||
public function addEntity($entityName, FinderInterface $finder, $repositoryName = null);
|
||||
|
||||
/**
|
||||
* Return repository for entity
|
||||
*
|
||||
* Returns custom repository if one specified otherwise
|
||||
* returns a basic repository.
|
||||
*
|
||||
* @param string $entityName
|
||||
*/
|
||||
public function getRepository($entityName);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue