From 025735e7308e619fa8258310b4b52e100e4b083a Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 27 Apr 2010 19:37:27 +0200 Subject: [PATCH] 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 --- UPGRADE_TO_2_0 | 13 +++++++++++++ lib/Doctrine/ORM/EntityRepository.php | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/UPGRADE_TO_2_0 b/UPGRADE_TO_2_0 index 24e7094bd..d1be43bf2 100644 --- a/UPGRADE_TO_2_0 +++ b/UPGRADE_TO_2_0 @@ -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 diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index de919430d..67eda3a47 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -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; + } } \ No newline at end of file