moved entitymanager and entityrepository
This commit is contained in:
parent
e64e33494a
commit
70c96548fd
17 changed files with 20 additions and 23 deletions
|
@ -356,7 +356,7 @@ class Doctrine_ClassMetadata implements Doctrine_Common_Configurable, Serializab
|
|||
* @param string $entityName Name of the entity class the metadata info is used for.
|
||||
* @param Doctrine::ORM::Entitymanager $em
|
||||
*/
|
||||
public function __construct($entityName, Doctrine_EntityManager $em)
|
||||
public function __construct($entityName, Doctrine_ORM_EntityManager $em)
|
||||
{
|
||||
$this->_entityName = $entityName;
|
||||
$this->_rootEntityName = $entityName;
|
||||
|
|
|
@ -51,7 +51,7 @@ class Doctrine_ClassMetadata_Factory
|
|||
* @param $conn The connection to use.
|
||||
* @param $driver The metadata driver to use.
|
||||
*/
|
||||
public function __construct(Doctrine_EntityManager $em, $driver)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em, $driver)
|
||||
{
|
||||
$this->_em = $em;
|
||||
$this->_driver = $driver;
|
||||
|
|
|
@ -120,7 +120,7 @@ class Doctrine_Connection_UnitOfWork
|
|||
*
|
||||
* @param Doctrine_EntityManager $em
|
||||
*/
|
||||
public function __construct(Doctrine_EntityManager $em)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em)
|
||||
{
|
||||
$this->_em = $em;
|
||||
//TODO: any benefit with lazy init?
|
||||
|
|
|
@ -130,7 +130,7 @@ class Doctrine_ORM_Collection implements Countable, IteratorAggregate, Serializa
|
|||
public function __construct($entityBaseType, $keyField = null)
|
||||
{
|
||||
$this->_entityBaseType = $entityBaseType;
|
||||
$this->_em = Doctrine_EntityManager::getActiveEntityManager();
|
||||
$this->_em = Doctrine_ORM_EntityManager::getActiveEntityManager();
|
||||
|
||||
if ($keyField !== null) {
|
||||
if ( ! $this->_em->getClassMetadata($entityBaseType)->hasField($keyField)) {
|
||||
|
@ -1018,7 +1018,7 @@ class Doctrine_ORM_Collection implements Countable, IteratorAggregate, Serializa
|
|||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$manager = Doctrine_EntityManager::getActiveEntityManager();
|
||||
$manager = Doctrine_ORM_EntityManager::getActiveEntityManager();
|
||||
$connection = $manager->getConnection();
|
||||
|
||||
$array = unserialize($serialized);
|
||||
|
|
|
@ -204,7 +204,7 @@ abstract class Doctrine_ORM_Entity implements ArrayAccess, Serializable
|
|||
public function __construct()
|
||||
{
|
||||
$this->_entityName = get_class($this);
|
||||
$this->_em = Doctrine_EntityManager::getActiveEntityManager();
|
||||
$this->_em = Doctrine_ORM_EntityManager::getActiveEntityManager();
|
||||
$this->_class = $this->_em->getClassMetadata($this->_entityName);
|
||||
$this->_oid = self::$_index++;
|
||||
$this->_data = $this->_em->_getTmpEntityData();
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* @version $Revision$
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class Doctrine_EntityManager
|
||||
class Doctrine_ORM_EntityManager
|
||||
{
|
||||
/**
|
||||
* IMMEDIATE: Flush occurs automatically after each operation that issues database
|
||||
|
@ -498,7 +498,7 @@ class Doctrine_EntityManager
|
|||
if ($customRepositoryClassName !== null) {
|
||||
$repository = new $customRepositoryClassName($entityName, $metadata);
|
||||
} else {
|
||||
$repository = new Doctrine_EntityRepository($entityName, $metadata);
|
||||
$repository = new Doctrine_ORM_EntityRepository($entityName, $metadata);
|
||||
}
|
||||
$this->_repositories[$entityName] = $repository;
|
||||
|
||||
|
@ -715,7 +715,7 @@ class Doctrine_EntityManager
|
|||
$eventManager = new Doctrine_Common_EventManager();
|
||||
}
|
||||
|
||||
$em = new Doctrine_EntityManager($conn, $name, $config, $eventManager);
|
||||
$em = new Doctrine_ORM_EntityManager($conn, $name, $config, $eventManager);
|
||||
$em->activate();
|
||||
|
||||
return $em;
|
|
@ -33,9 +33,8 @@
|
|||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @todo package:orm
|
||||
*/
|
||||
class Doctrine_EntityRepository
|
||||
class Doctrine_ORM_EntityRepository
|
||||
{
|
||||
protected $_entityName;
|
||||
protected $_em;
|
|
@ -34,6 +34,4 @@
|
|||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class Doctrine_ORM_Exceptions_ORMException extends Doctrine_Common_Exceptions_DoctrineException
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
|
|
@ -13,7 +13,7 @@ abstract class Doctrine_ORM_Id_AbstractIdGenerator
|
|||
|
||||
protected $_em;
|
||||
|
||||
public function __construct(Doctrine_EntityManager $em)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em)
|
||||
{
|
||||
$this->_em = $em;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ abstract class Doctrine_ORM_Internal_Hydration_AbstractHydrator
|
|||
*
|
||||
* @param Doctrine_Connection|null $connection
|
||||
*/
|
||||
public function __construct(Doctrine_EntityManager $em)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em)
|
||||
{
|
||||
$this->_em = $em;
|
||||
$this->_nullObject = Doctrine_ORM_Internal_Null::$INSTANCE;
|
||||
|
|
|
@ -41,7 +41,7 @@ class Doctrine_ORM_Internal_Hydration_ObjectDriver
|
|||
/** The EntityManager */
|
||||
private $_em;
|
||||
|
||||
public function __construct(Doctrine_EntityManager $em)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em)
|
||||
{
|
||||
$this->_nullObject = Doctrine_ORM_Internal_Null::$INSTANCE;
|
||||
$this->_em = $em;
|
||||
|
|
|
@ -74,7 +74,7 @@ abstract class Doctrine_ORM_Persisters_AbstractEntityPersister
|
|||
/**
|
||||
* Constructs a new EntityPersister.
|
||||
*/
|
||||
public function __construct(Doctrine_EntityManager $em, Doctrine_ClassMetadata $classMetadata)
|
||||
public function __construct(Doctrine_ORM_EntityManager $em, Doctrine_ClassMetadata $classMetadata)
|
||||
{
|
||||
$this->_em = $em;
|
||||
$this->_entityName = $classMetadata->getClassName();
|
||||
|
|
|
@ -93,7 +93,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract
|
|||
// End of Caching Stuff
|
||||
|
||||
|
||||
public function __construct(Doctrine_EntityManager $entityManager)
|
||||
public function __construct(Doctrine_ORM_EntityManager $entityManager)
|
||||
{
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_hydrator = new Doctrine_ORM_Internal_Hydration_StandardHydrator($entityManager);
|
||||
|
|
|
@ -42,7 +42,7 @@ abstract class Doctrine_Query_SqlBuilder
|
|||
protected $_connection;
|
||||
|
||||
|
||||
public static function fromConnection(Doctrine_EntityManager $entityManager)
|
||||
public static function fromConnection(Doctrine_ORM_EntityManager $entityManager)
|
||||
{
|
||||
$connection = $entityManager->getConnection();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class Doctrine_OrmTestCase extends Doctrine_TestCase
|
|||
'user' => 'john',
|
||||
'password' => 'wayne'
|
||||
);
|
||||
$em = Doctrine_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
||||
$em = Doctrine_ORM_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
||||
$this->_em = $em;
|
||||
}
|
||||
$this->_em->activate();
|
||||
|
|
|
@ -17,7 +17,7 @@ class Doctrine_OrmTestSuite extends Doctrine_TestSuite
|
|||
'user' => 'john',
|
||||
'password' => 'wayne'
|
||||
);
|
||||
$em = Doctrine_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
||||
$em = Doctrine_ORM_EntityManager::create($connectionOptions, 'mockEM', $config, $eventManager);
|
||||
$this->sharedFixture['em'] = $em;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require_once 'lib/mocks/Doctrine_EntityPersisterMock.php';
|
||||
|
||||
class Doctrine_EntityManagerMock extends Doctrine_EntityManager
|
||||
class Doctrine_EntityManagerMock extends Doctrine_ORM_EntityManager
|
||||
{
|
||||
private $_persisterMock;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue