Skip to content

Commit

Permalink
DDC-536 - Make forwards compatible change in EntityRepository adding …
Browse files Browse the repository at this point in the history
…getters for the protected variables to allow a smooth change when they will be turned private in Beta2
  • Loading branch information
beberlei committed Apr 27, 2010
1 parent 0f7d71c commit 025735e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions UPGRADE_TO_2_0
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 24 additions & 0 deletions lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,28 @@ public function __call($method, $arguments)
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;
}
}

0 comments on commit 025735e

Please sign in to comment.