1
0
mirror of synced 2025-02-20 14:13:15 +03:00

DDC-536 - Make forwards compatible change in EntityRepository adding getters for the protected variables to allow a smooth change when they will be turned private in Beta2

This commit is contained in:
Benjamin Eberlei 2010-04-27 19:37:27 +02:00
parent 0f7d71cac4
commit 025735e730
2 changed files with 37 additions and 0 deletions

View File

@ -1,6 +1,19 @@
# Upgrade from 2.0-ALPHA4 to 2.0-BETA1
## EntityRepository deprecates access to protected variables
Instead of accessing protected variables for the EntityManager in
a custom EntityRepository it is now required to use the getter methods
for all the three instance variables:
* `$this->_em` now accessible through `$this->getEntityManager()`
* `$this->_class` now accessible through `$this->getClassMetadata()`
* `$this->_entityName` now accessible through `$this->getEntityName()`
Important: For Beta 2 the protected visibility of these three properties will be
changed to private!
## Console migrated to Symfony Console
The Doctrine CLI has been replaced by Symfony Console Configuration

View File

@ -176,4 +176,28 @@ class EntityRepository
throw ORMException::invalidFindByCall($this->_entityName, $fieldName, $method.$by);
}
}
/**
* @return string
*/
protected function getEntityName()
{
return $this->_entityName;
}
/**
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->_em;
}
/**
* @return Mapping\ClassMetadata
*/
protected function getClassMetadata()
{
return $this->_class;
}
}