From 511bf2248eea35ad30c38daa64fed61c55be34b4 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Tue, 30 Mar 2010 21:14:17 +0000 Subject: [PATCH] [2.0] Fixed and added some missing/wrong docblocks. Renamed Assigned to AssignedGenerator as scheduled to be renamed. --- .../Common/Annotations/AnnotationReader.php | 1 + lib/Doctrine/Common/Cache/ApcCache.php | 3 ++- lib/Doctrine/Common/Cache/ArrayCache.php | 1 + lib/Doctrine/Common/Cache/Cache.php | 1 + lib/Doctrine/Common/Cache/MemcacheCache.php | 1 + lib/Doctrine/Common/Cache/XcacheCache.php | 2 +- lib/Doctrine/ORM/AbstractQuery.php | 16 +++++++++------- lib/Doctrine/ORM/Configuration.php | 5 ++++- lib/Doctrine/ORM/EntityManager.php | 11 ++++++----- lib/Doctrine/ORM/EntityRepository.php | 11 +++++++---- .../Id/{Assigned.php => AssignedGenerator.php} | 13 +++++++++---- lib/Doctrine/ORM/Id/TableGenerator.php | 10 ++++++++-- .../ORM/Mapping/ClassMetadataFactory.php | 5 +++-- lib/Doctrine/ORM/UnitOfWork.php | 7 +++++-- tests/Doctrine/Tests/ORM/Id/AllTests.php | 2 +- ...ignedIdTest.php => AssignedGeneratorTest.php} | 8 ++++---- 16 files changed, 63 insertions(+), 34 deletions(-) rename lib/Doctrine/ORM/Id/{Assigned.php => AssignedGenerator.php} (85%) rename tests/Doctrine/Tests/ORM/Id/{AssignedIdTest.php => AssignedGeneratorTest.php} (90%) diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index 9e519884f..bed578e35 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -33,6 +33,7 @@ use \ReflectionClass, * @link www.doctrine-project.org * @since 2.0 * @version $Revision: 3938 $ + * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel diff --git a/lib/Doctrine/Common/Cache/ApcCache.php b/lib/Doctrine/Common/Cache/ApcCache.php index 0831a779e..cf277a4fe 100644 --- a/lib/Doctrine/Common/Cache/ApcCache.php +++ b/lib/Doctrine/Common/Cache/ApcCache.php @@ -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 * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel diff --git a/lib/Doctrine/Common/Cache/ArrayCache.php b/lib/Doctrine/Common/Cache/ArrayCache.php index f4e95aca9..d3285f7d1 100644 --- a/lib/Doctrine/Common/Cache/ArrayCache.php +++ b/lib/Doctrine/Common/Cache/ArrayCache.php @@ -28,6 +28,7 @@ namespace Doctrine\Common\Cache; * @link www.doctrine-project.org * @since 2.0 * @version $Revision: 3938 $ + * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel diff --git a/lib/Doctrine/Common/Cache/Cache.php b/lib/Doctrine/Common/Cache/Cache.php index 7bcaa40c8..e4cb1c074 100644 --- a/lib/Doctrine/Common/Cache/Cache.php +++ b/lib/Doctrine/Common/Cache/Cache.php @@ -28,6 +28,7 @@ namespace Doctrine\Common\Cache; * @link www.doctrine-project.org * @since 2.0 * @version $Revision: 3938 $ + * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel diff --git a/lib/Doctrine/Common/Cache/MemcacheCache.php b/lib/Doctrine/Common/Cache/MemcacheCache.php index ed1c4bae8..a76bd170e 100644 --- a/lib/Doctrine/Common/Cache/MemcacheCache.php +++ b/lib/Doctrine/Common/Cache/MemcacheCache.php @@ -30,6 +30,7 @@ use \Memcache; * @link www.doctrine-project.org * @since 2.0 * @version $Revision: 3938 $ + * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel diff --git a/lib/Doctrine/Common/Cache/XcacheCache.php b/lib/Doctrine/Common/Cache/XcacheCache.php index 1ec98502c..fadf2c322 100644 --- a/lib/Doctrine/Common/Cache/XcacheCache.php +++ b/lib/Doctrine/Common/Cache/XcacheCache.php @@ -28,11 +28,11 @@ namespace Doctrine\Common\Cache; * @link www.doctrine-project.org * @since 2.0 * @version $Revision: 3938 $ + * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel * @author David Abdemoulaie - * @author Benjamin Eberlei */ class XcacheCache extends AbstractCache { diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index bd0cdf837..b872e9845 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -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 - * @author Konsta Vesterinen - * @author Roman Borschel + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision$ + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Konsta Vesterinen */ abstract class AbstractQuery { diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index 560338ecd..6d5964c8c 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -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 * @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 + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class Configuration extends \Doctrine\DBAL\Configuration { diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index c0a1208d0..897569b8c 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -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 - * @todo Remove flush modes. They dont seem to be of much use. Manual flushing should - * be enough. + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class EntityManager { diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index ae96ef8a3..1382cb5e6 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -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 - * @author Jonathan H. Wage + * @link www.doctrine-project.org + * @since 2.0 + * @version $Revision$ + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class EntityRepository { diff --git a/lib/Doctrine/ORM/Id/Assigned.php b/lib/Doctrine/ORM/Id/AssignedGenerator.php similarity index 85% rename from lib/Doctrine/ORM/Id/Assigned.php rename to lib/Doctrine/ORM/Id/AssignedGenerator.php index ceaef2c05..226d2b406 100644 --- a/lib/Doctrine/ORM/Id/Assigned.php +++ b/lib/Doctrine/ORM/Id/AssignedGenerator.php @@ -27,11 +27,16 @@ use Doctrine\ORM\ORMException; /** * Special generator for application-assigned identifiers (doesnt really generate anything). * - * @since 2.0 - * @author Roman Borschel - * @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 + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ -class Assigned extends AbstractIdGenerator +class AssignedGenerator extends AbstractIdGenerator { /** * Returns the identifier assigned to the given entity. diff --git a/lib/Doctrine/ORM/Id/TableGenerator.php b/lib/Doctrine/ORM/Id/TableGenerator.php index a472a6de3..12ee0a2b3 100644 --- a/lib/Doctrine/ORM/Id/TableGenerator.php +++ b/lib/Doctrine/ORM/Id/TableGenerator.php @@ -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 + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel */ class TableGenerator extends AbstractIdGenerator { diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index f00422fcf..99df4ccfd 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -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 * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel @@ -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."); diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index e71a057e0..d1a89bed4 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -37,6 +37,9 @@ use Doctrine\Common\Collections\ArrayCollection, * @link www.doctrine-project.org * @since 2.0 * @version $Revision$ + * @author Benjamin Eberlei + * @author Guilherme Blanco + * @author Jonathan Wage * @author Roman Borschel * @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 { diff --git a/tests/Doctrine/Tests/ORM/Id/AllTests.php b/tests/Doctrine/Tests/ORM/Id/AllTests.php index 9a7c7dfb1..87201d915 100644 --- a/tests/Doctrine/Tests/ORM/Id/AllTests.php +++ b/tests/Doctrine/Tests/ORM/Id/AllTests.php @@ -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; } diff --git a/tests/Doctrine/Tests/ORM/Id/AssignedIdTest.php b/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php similarity index 90% rename from tests/Doctrine/Tests/ORM/Id/AssignedIdTest.php rename to tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php index 7bcae7779..6a645d8b0 100644 --- a/tests/Doctrine/Tests/ORM/Id/AssignedIdTest.php +++ b/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php @@ -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()