[2.0] Fixed and added some missing/wrong docblocks. Renamed Assigned to AssignedGenerator as scheduled to be renamed.
This commit is contained in:
parent
517bb66468
commit
511bf2248e
16 changed files with 63 additions and 34 deletions
|
@ -33,6 +33,7 @@ use \ReflectionClass,
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
|
|
@ -27,7 +27,8 @@ namespace Doctrine\Common\Cache;
|
|||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace Doctrine\Common\Cache;
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace Doctrine\Common\Cache;
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
|
|
@ -30,6 +30,7 @@ use \Memcache;
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
|
|
@ -28,11 +28,11 @@ namespace Doctrine\Common\Cache;
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author David Abdemoulaie <dave@hobodave.com>
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
*/
|
||||
class XcacheCache extends AbstractCache
|
||||
{
|
||||
|
|
|
@ -27,13 +27,15 @@ use Doctrine\DBAL\Types\Type,
|
|||
/**
|
||||
* Base contract for ORM queries. Base class for Query and NativeQuery.
|
||||
*
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.com
|
||||
* @since 1.0
|
||||
* @version $Revision: 1393 $
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
*/
|
||||
abstract class AbstractQuery
|
||||
{
|
||||
|
|
|
@ -25,10 +25,13 @@ namespace Doctrine\ORM;
|
|||
* Configuration container for all configuration options of Doctrine.
|
||||
* It combines all configuration options from DBAL & ORM.
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @since 2.0
|
||||
* @internal When adding a new configuration option just write a getter/setter
|
||||
* pair and add the option to the _attributes array with a proper default value.
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class Configuration extends \Doctrine\DBAL\Configuration
|
||||
{
|
||||
|
|
|
@ -31,12 +31,13 @@ use Doctrine\Common\EventManager,
|
|||
* The EntityManager is the central access point to ORM functionality.
|
||||
*
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @todo Remove flush modes. They dont seem to be of much use. Manual flushing should
|
||||
* be enough.
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class EntityManager
|
||||
{
|
||||
|
|
|
@ -29,10 +29,13 @@ namespace Doctrine\ORM;
|
|||
* write their own repositories with business-specific methods to locate entities.
|
||||
*
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class EntityRepository
|
||||
{
|
||||
|
|
|
@ -27,11 +27,16 @@ use Doctrine\ORM\ORMException;
|
|||
/**
|
||||
* Special generator for application-assigned identifiers (doesnt really generate anything).
|
||||
*
|
||||
* @since 2.0
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @todo Rename: AssignedGenerator?
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class Assigned extends AbstractIdGenerator
|
||||
class AssignedGenerator extends AbstractIdGenerator
|
||||
{
|
||||
/**
|
||||
* Returns the identifier assigned to the given entity.
|
|
@ -7,8 +7,14 @@ use Doctrine\ORM\EntityManager;
|
|||
/**
|
||||
* Id generator that uses a single-row database table and a hi/lo algorithm.
|
||||
*
|
||||
* @since 2.0
|
||||
* @todo Implementation
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class TableGenerator extends AbstractIdGenerator
|
||||
{
|
||||
|
|
|
@ -33,7 +33,8 @@ use Doctrine\ORM\ORMException,
|
|||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision: 3938 $
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
|
@ -388,7 +389,7 @@ class ClassMetadataFactory
|
|||
$class->setIdGenerator($sequenceGenerator);
|
||||
break;
|
||||
case ClassMetadata::GENERATOR_TYPE_NONE:
|
||||
$class->setIdGenerator(new \Doctrine\ORM\Id\Assigned());
|
||||
$class->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());
|
||||
break;
|
||||
case ClassMetadata::GENERATOR_TYPE_TABLE:
|
||||
throw new ORMException("TableGenerator not yet implemented.");
|
||||
|
|
|
@ -37,6 +37,9 @@ use Doctrine\Common\Collections\ArrayCollection,
|
|||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
||||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
||||
* @author Jonathan Wage <jonwage@gmail.com>
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @internal This class contains performance-critical code.
|
||||
*/
|
||||
|
@ -585,7 +588,7 @@ class UnitOfWork implements PropertyChangedListener
|
|||
$idGen = $targetClass->idGenerator;
|
||||
if ( ! $idGen->isPostInsertGenerator()) {
|
||||
$idValue = $idGen->generate($this->_em, $entry);
|
||||
if ( ! $idGen instanceof \Doctrine\ORM\Id\Assigned) {
|
||||
if ( ! $idGen instanceof \Doctrine\ORM\Id\AssignedGenerator) {
|
||||
$this->_entityIdentifiers[$oid] = array($targetClass->identifier[0] => $idValue);
|
||||
$targetClass->getSingleIdReflectionProperty()->setValue($entry, $idValue);
|
||||
} else {
|
||||
|
@ -1200,7 +1203,7 @@ class UnitOfWork implements PropertyChangedListener
|
|||
$idGen = $class->idGenerator;
|
||||
if ( ! $idGen->isPostInsertGenerator()) {
|
||||
$idValue = $idGen->generate($this->_em, $entity);
|
||||
if ( ! $idGen instanceof \Doctrine\ORM\Id\Assigned) {
|
||||
if ( ! $idGen instanceof \Doctrine\ORM\Id\AssignedGenerator) {
|
||||
$this->_entityIdentifiers[$oid] = array($class->identifier[0] => $idValue);
|
||||
$class->setIdentifierValues($entity, $idValue);
|
||||
} else {
|
||||
|
|
|
@ -20,7 +20,7 @@ class AllTests
|
|||
$suite = new \Doctrine\Tests\DoctrineTestSuite('Doctrine Orm Id');
|
||||
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Id\SequenceGeneratorTest');
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Id\AssignedIdTest');
|
||||
$suite->addTestSuite('Doctrine\Tests\ORM\Id\AssignedGeneratorTest');
|
||||
|
||||
return $suite;
|
||||
}
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace Doctrine\Tests\ORM\Id;
|
||||
|
||||
use Doctrine\ORM\Id\Assigned;
|
||||
use Doctrine\ORM\Id\AssignedGenerator;
|
||||
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* AssignedIdTest
|
||||
* AssignedGeneratorTest
|
||||
*
|
||||
* @author robo
|
||||
*/
|
||||
class AssignedIdTest extends \Doctrine\Tests\OrmTestCase
|
||||
class AssignedGeneratorTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
private $_em;
|
||||
private $_assignedGen;
|
||||
|
@ -19,7 +19,7 @@ class AssignedIdTest extends \Doctrine\Tests\OrmTestCase
|
|||
protected function setUp()
|
||||
{
|
||||
$this->_em = $this->_getTestEntityManager();
|
||||
$this->_assignedGen = new Assigned;
|
||||
$this->_assignedGen = new AssignedGenerator;
|
||||
}
|
||||
|
||||
public function testThrowsExceptionIfIdNotAssigned()
|
Loading…
Add table
Reference in a new issue