2011-06-08 07:07:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Symfony\Bridge\Doctrine;
|
|
|
|
|
2011-10-15 10:26:58 +01:00
|
|
|
use Doctrine\Common\Persistence\ManagerRegistry as ManagerRegistryInterface;
|
2011-06-08 07:07:12 +01:00
|
|
|
use Doctrine\ORM\Configuration;
|
2011-09-23 08:26:24 +01:00
|
|
|
|
2011-06-08 07:07:12 +01:00
|
|
|
/**
|
|
|
|
* References Doctrine connections and entity managers.
|
|
|
|
*
|
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
*/
|
2011-10-15 10:26:58 +01:00
|
|
|
interface RegistryInterface extends ManagerRegistryInterface
|
2011-06-08 07:07:12 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Gets the default entity manager name.
|
|
|
|
*
|
|
|
|
* @return string The default entity manager name
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getDefaultEntityManagerName();
|
2011-06-08 07:07:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a named entity manager.
|
|
|
|
*
|
|
|
|
* @param string $name The entity manager name (null for the default one)
|
|
|
|
*
|
|
|
|
* @return EntityManager
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getEntityManager($name = null);
|
2011-06-08 07:07:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets an array of all registered entity managers
|
|
|
|
*
|
|
|
|
* @return array An array of EntityManager instances
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getEntityManagers();
|
2011-06-08 07:07:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resets a named entity manager.
|
|
|
|
*
|
|
|
|
* This method is useful when an entity manager has been closed
|
|
|
|
* because of a rollbacked transaction AND when you think that
|
|
|
|
* it makes sense to get a new one to replace the closed one.
|
|
|
|
*
|
|
|
|
* Be warned that you will get a brand new entity manager as
|
|
|
|
* the existing one is not useable anymore. This means that any
|
|
|
|
* other object with a dependency on this entity manager will
|
|
|
|
* hold an obsolete reference. You can inject the registry instead
|
|
|
|
* to avoid this problem.
|
|
|
|
*
|
|
|
|
* @param string $name The entity manager name (null for the default one)
|
|
|
|
*
|
|
|
|
* @return EntityManager
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function resetEntityManager($name = null);
|
2011-06-08 07:07:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resolves a registered namespace alias to the full namespace.
|
|
|
|
*
|
|
|
|
* This method looks for the alias in all registered entity managers.
|
|
|
|
*
|
|
|
|
* @param string $alias The alias
|
|
|
|
*
|
|
|
|
* @return string The full namespace
|
|
|
|
*
|
|
|
|
* @see Configuration::getEntityNamespace
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getEntityNamespace($alias);
|
2011-06-08 07:07:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets all connection names.
|
|
|
|
*
|
|
|
|
* @return array An array of connection names
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getEntityManagerNames();
|
2011-06-08 07:07:12 +01:00
|
|
|
|
2011-07-06 11:33:49 +01:00
|
|
|
/**
|
2011-07-19 18:24:57 +01:00
|
|
|
* Gets the entity manager associated with a given class.
|
2011-07-06 11:33:49 +01:00
|
|
|
*
|
2011-07-19 18:24:57 +01:00
|
|
|
* @param string $class A Doctrine Entity class name
|
2011-07-06 11:33:49 +01:00
|
|
|
*
|
|
|
|
* @return EntityManager|null
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getEntityManagerForClass($class);
|
2011-06-08 07:07:12 +01:00
|
|
|
}
|