diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php
index 5d6a91d13..0f0078a7e 100644
--- a/lib/Doctrine/ORM/AbstractQuery.php
+++ b/lib/Doctrine/ORM/AbstractQuery.php
@@ -42,18 +42,22 @@ use Doctrine\ORM\ORMInvalidArgumentException;
abstract class AbstractQuery
{
/* Hydration mode constants */
+
/**
* Hydrates an object graph. This is the default behavior.
*/
const HYDRATE_OBJECT = 1;
+
/**
* Hydrates an array graph.
*/
const HYDRATE_ARRAY = 2;
+
/**
* Hydrates a flat, rectangular result set with scalar values.
*/
const HYDRATE_SCALAR = 3;
+
/**
* Hydrates a single scalar value.
*/
@@ -65,27 +69,37 @@ abstract class AbstractQuery
const HYDRATE_SIMPLEOBJECT = 5;
/**
- * @var \Doctrine\Common\Collections\ArrayCollection The parameter map of this query.
+ * The parameter map of this query.
+ *
+ * @var \Doctrine\Common\Collections\ArrayCollection
*/
protected $parameters;
/**
- * @var \Doctrine\ORM\Query\ResultSetMapping The user-specified ResultSetMapping to use.
+ * The user-specified ResultSetMapping to use.
+ *
+ * @var \Doctrine\ORM\Query\ResultSetMapping
*/
protected $_resultSetMapping;
/**
- * @var \Doctrine\ORM\EntityManager The entity manager used by this query object.
+ * The entity manager used by this query object.
+ *
+ * @var \Doctrine\ORM\EntityManager
*/
protected $_em;
/**
- * @var array The map of query hints.
+ * The map of query hints.
+ *
+ * @var array
*/
protected $_hints = array();
/**
- * @var integer The hydration mode.
+ * The hydration mode.
+ *
+ * @var integer
*/
protected $_hydrationMode = self::HYDRATE_OBJECT;
@@ -95,7 +109,9 @@ abstract class AbstractQuery
protected $_queryCacheProfile;
/**
- * @var boolean Boolean value that indicates whether or not expire the result cache.
+ * Whether or not expire the result cache.
+ *
+ * @var boolean
*/
protected $_expireResultCache = false;
@@ -107,7 +123,7 @@ abstract class AbstractQuery
/**
* Initializes a new instance of a class derived from AbstractQuery.
*
- * @param \Doctrine\ORM\EntityManager $entityManager
+ * @param \Doctrine\ORM\EntityManager $em
*/
public function __construct(EntityManager $em)
{
@@ -208,11 +224,11 @@ abstract class AbstractQuery
/**
* Sets a query parameter.
*
- * @param string|integer $key The parameter position or name.
- * @param mixed $value The parameter value.
- * @param string $type The parameter type. If specified, the given value will be run through
- * the type conversion of this type. This is usually not needed for
- * strings and numeric types.
+ * @param string|int $key The parameter position or name.
+ * @param mixed $value The parameter value.
+ * @param string|null $type The parameter type. If specified, the given value will be run through
+ * the type conversion of this type. This is usually not needed for
+ * strings and numeric types.
*
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
@@ -241,10 +257,13 @@ abstract class AbstractQuery
}
/**
- * Process an individual parameter value
+ * Processes an individual parameter value.
*
* @param mixed $value
+ *
* @return array
+ *
+ * @throws ORMInvalidArgumentException
*/
public function processParameterValue($value)
{
@@ -272,6 +291,7 @@ abstract class AbstractQuery
* Sets the ResultSetMapping that should be used for hydration.
*
* @param \Doctrine\ORM\Query\ResultSetMapping $rsm
+ *
* @return \Doctrine\ORM\AbstractQuery
*/
public function setResultSetMapping(Query\ResultSetMapping $rsm)
@@ -300,6 +320,7 @@ abstract class AbstractQuery
* $query->setHydrationCacheProfile(new QueryCacheProfile($lifetime, $resultKey));
*
* @param \Doctrine\DBAL\Cache\QueryCacheProfile $profile
+ *
* @return \Doctrine\ORM\AbstractQuery
*/
public function setHydrationCacheProfile(QueryCacheProfile $profile = null)
@@ -329,6 +350,7 @@ abstract class AbstractQuery
* result cache driver is used from the configuration.
*
* @param \Doctrine\DBAL\Cache\QueryCacheProfile $profile
+ *
* @return \Doctrine\ORM\AbstractQuery
*/
public function setResultCacheProfile(QueryCacheProfile $profile = null)
@@ -346,8 +368,11 @@ abstract class AbstractQuery
/**
* Defines a cache driver to be used for caching result sets and implictly enables caching.
*
- * @param \Doctrine\Common\Cache\Cache $driver Cache driver
+ * @param \Doctrine\Common\Cache\Cache|null $resultCacheDriver Cache driver
+ *
* @return \Doctrine\ORM\AbstractQuery
+ *
+ * @throws ORMException
*/
public function setResultCacheDriver($resultCacheDriver = null)
{
@@ -366,6 +391,7 @@ abstract class AbstractQuery
* Returns the cache driver used for caching result sets.
*
* @deprecated
+ *
* @return \Doctrine\Common\Cache\Cache Cache driver
*/
public function getResultCacheDriver()
@@ -383,7 +409,8 @@ abstract class AbstractQuery
*
* @param boolean $bool
* @param integer $lifetime
- * @param string $resultCacheId
+ * @param string $resultCacheId
+ *
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
public function useResultCache($bool, $lifetime = null, $resultCacheId = null)
@@ -404,6 +431,7 @@ abstract class AbstractQuery
* Defines how long the result cache will be active before expire.
*
* @param integer $lifetime How long the cache entry is valid.
+ *
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
public function setResultCacheLifetime($lifetime)
@@ -421,6 +449,7 @@ abstract class AbstractQuery
* Retrieves the lifetime of resultset cache.
*
* @deprecated
+ *
* @return integer
*/
public function getResultCacheLifetime()
@@ -432,6 +461,7 @@ abstract class AbstractQuery
* Defines if the result cache is active or not.
*
* @param boolean $expire Whether or not to force resultset cache expiration.
+ *
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
public function expireResultCache($expire = true)
@@ -464,9 +494,10 @@ abstract class AbstractQuery
*
* $fetchMode can be one of ClassMetadata::FETCH_EAGER or ClassMetadata::FETCH_LAZY
*
- * @param string $class
- * @param string $assocName
- * @param int $fetchMode
+ * @param string $class
+ * @param string $assocName
+ * @param int $fetchMode
+ *
* @return AbstractQuery
*/
public function setFetchMode($class, $assocName, $fetchMode)
@@ -485,6 +516,7 @@ abstract class AbstractQuery
*
* @param integer $hydrationMode Doctrine processing mode to be used during hydration process.
* One of the Query::HYDRATE_* constants.
+ *
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
public function setHydrationMode($hydrationMode)
@@ -509,6 +541,8 @@ abstract class AbstractQuery
*
* Alias for execute(null, $hydrationMode = HYDRATE_OBJECT).
*
+ * @param int $hydrationMode
+ *
* @return array
*/
public function getResult($hydrationMode = self::HYDRATE_OBJECT)
@@ -543,9 +577,11 @@ abstract class AbstractQuery
/**
* Get exactly one result or null.
*
- * @throws NonUniqueResultException
* @param int $hydrationMode
+ *
* @return mixed
+ *
+ * @throws NonUniqueResultException
*/
public function getOneOrNullResult($hydrationMode = null)
{
@@ -575,9 +611,11 @@ abstract class AbstractQuery
* If there is no result, a NoResultException is thrown.
*
* @param integer $hydrationMode
+ *
* @return mixed
+ *
* @throws NonUniqueResultException If the query result is not unique.
- * @throws NoResultException If the query returned no result.
+ * @throws NoResultException If the query returned no result.
*/
public function getSingleResult($hydrationMode = null)
{
@@ -604,6 +642,7 @@ abstract class AbstractQuery
* Alias for getSingleResult(HYDRATE_SINGLE_SCALAR).
*
* @return mixed
+ *
* @throws QueryException If the query result is not unique.
*/
public function getSingleScalarResult()
@@ -614,8 +653,9 @@ abstract class AbstractQuery
/**
* Sets a query hint. If the hint name is not recognized, it is silently ignored.
*
- * @param string $name The name of the hint.
- * @param mixed $value The value of the hint.
+ * @param string $name The name of the hint.
+ * @param mixed $value The value of the hint.
+ *
* @return \Doctrine\ORM\AbstractQuery
*/
public function setHint($name, $value)
@@ -629,6 +669,7 @@ abstract class AbstractQuery
* Gets the value of a query hint. If the hint name is not recognized, FALSE is returned.
*
* @param string $name The name of the hint.
+ *
* @return mixed The value of the hint or FALSE, if the hint name is not recognized.
*/
public function getHint($name)
@@ -650,8 +691,9 @@ abstract class AbstractQuery
* Executes the query and returns an IterableResult that can be used to incrementally
* iterate over the result.
*
- * @param \Doctrine\Common\Collections\ArrayCollection|array $parameters The query parameters.
- * @param integer $hydrationMode The hydration mode to use.
+ * @param ArrayCollection|array|null $parameters The query parameters.
+ * @param integer|null $hydrationMode The hydration mode to use.
+ *
* @return \Doctrine\ORM\Internal\Hydration\IterableResult
*/
public function iterate($parameters = null, $hydrationMode = null)
@@ -674,8 +716,9 @@ abstract class AbstractQuery
/**
* Executes the query.
*
- * @param \Doctrine\Common\Collections\ArrayCollection|array $parameters Query parameters.
- * @param integer $hydrationMode Processing mode to be used during the hydration process.
+ * @param ArrayCollection|array|null $parameters Query parameters.
+ * @param integer|null $hydrationMode Processing mode to be used during the hydration process.
+ *
* @return mixed
*/
public function execute($parameters = null, $hydrationMode = null)
@@ -760,6 +803,7 @@ abstract class AbstractQuery
* generated for you.
*
* @param string $id
+ *
* @return \Doctrine\ORM\AbstractQuery This query instance.
*/
public function setResultCacheId($id)
@@ -775,6 +819,7 @@ abstract class AbstractQuery
* Get the result cache id to use to store the result set cache entry if set.
*
* @deprecated
+ *
* @return string
*/
public function getResultCacheId()
diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php
index 78f0db898..5e19d29bd 100644
--- a/lib/Doctrine/ORM/Configuration.php
+++ b/lib/Doctrine/ORM/Configuration.php
@@ -49,6 +49,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the directory where Doctrine generates any necessary proxy class files.
*
* @param string $dir
+ *
+ * @return void
*/
public function setProxyDir($dir)
{
@@ -58,7 +60,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the directory where Doctrine generates any necessary proxy class files.
*
- * @return string
+ * @return string|null
*/
public function getProxyDir()
{
@@ -85,6 +87,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* during each script execution.
*
* @param boolean $bool
+ *
+ * @return void
*/
public function setAutoGenerateProxyClasses($bool)
{
@@ -94,7 +98,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the namespace where proxy classes reside.
*
- * @return string
+ * @return string|null
*/
public function getProxyNamespace()
{
@@ -107,6 +111,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the namespace where proxy classes reside.
*
* @param string $ns
+ *
+ * @return void
*/
public function setProxyNamespace($ns)
{
@@ -117,6 +123,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the cache driver implementation that is used for metadata caching.
*
* @param MappingDriver $driverImpl
+ *
+ * @return void
+ *
* @todo Force parameter to be a Closure to ensure lazy evaluation
* (as soon as a metadata cache is in effect, the driver never needs to initialize).
*/
@@ -126,11 +135,12 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Add a new default annotation driver with a correctly configured annotation reader. If $useSimpleAnnotationReader
+ * Adds a new default annotation driver with a correctly configured annotation reader. If $useSimpleAnnotationReader
* is true, the notation `@Entity` will work, otherwise, the notation `@ORM\Entity` will be supported.
*
* @param array $paths
- * @param bool $useSimpleAnnotationReader
+ * @param bool $useSimpleAnnotationReader
+ *
* @return AnnotationDriver
*/
public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true)
@@ -157,6 +167,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
*
* @param string $alias
* @param string $namespace
+ *
+ * @return void
*/
public function addEntityNamespace($alias, $namespace)
{
@@ -167,8 +179,10 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Resolves a registered namespace alias to the full namespace.
*
* @param string $entityNamespaceAlias
- * @throws ORMException
+ *
* @return string
+ *
+ * @throws ORMException
*/
public function getEntityNamespace($entityNamespaceAlias)
{
@@ -180,9 +194,11 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set the entity alias map
+ * Sets the entity alias map.
*
* @param array $entityNamespaces
+ *
+ * @return void
*/
public function setEntityNamespaces(array $entityNamespaces)
{
@@ -202,8 +218,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for the mapping metadata.
*
+ * @return MappingDriver|null
+ *
* @throws ORMException
- * @return MappingDriver
*/
public function getMetadataDriverImpl()
{
@@ -215,7 +232,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for the query cache (SQL cache).
*
- * @return \Doctrine\Common\Cache\Cache
+ * @return \Doctrine\Common\Cache\Cache|null
*/
public function getQueryCacheImpl()
{
@@ -228,6 +245,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the cache driver implementation that is used for the query cache (SQL cache).
*
* @param \Doctrine\Common\Cache\Cache $cacheImpl
+ *
+ * @return void
*/
public function setQueryCacheImpl(Cache $cacheImpl)
{
@@ -237,7 +256,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for the hydration cache (SQL cache).
*
- * @return \Doctrine\Common\Cache\Cache
+ * @return \Doctrine\Common\Cache\Cache|null
*/
public function getHydrationCacheImpl()
{
@@ -250,6 +269,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the cache driver implementation that is used for the hydration cache (SQL cache).
*
* @param \Doctrine\Common\Cache\Cache $cacheImpl
+ *
+ * @return void
*/
public function setHydrationCacheImpl(Cache $cacheImpl)
{
@@ -259,7 +280,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the cache driver implementation that is used for metadata caching.
*
- * @return \Doctrine\Common\Cache\Cache
+ * @return \Doctrine\Common\Cache\Cache|null
*/
public function getMetadataCacheImpl()
{
@@ -272,6 +293,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Sets the cache driver implementation that is used for metadata caching.
*
* @param \Doctrine\Common\Cache\Cache $cacheImpl
+ *
+ * @return void
*/
public function setMetadataCacheImpl(Cache $cacheImpl)
{
@@ -282,7 +305,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Adds a named DQL query to the configuration.
*
* @param string $name The name of the query.
- * @param string $dql The DQL query string.
+ * @param string $dql The DQL query string.
+ *
+ * @return void
*/
public function addNamedQuery($name, $dql)
{
@@ -293,8 +318,10 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Gets a previously registered named DQL query.
*
* @param string $name The name of the query.
- * @throws ORMException
+ *
* @return string The DQL query.
+ *
+ * @throws ORMException
*/
public function getNamedQuery($name)
{
@@ -311,6 +338,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* @param string $name The name of the query.
* @param string $sql The native SQL query string.
* @param Query\ResultSetMapping $rsm The ResultSetMapping used for the results of the SQL query.
+ *
+ * @return void
*/
public function addNamedNativeQuery($name, $sql, Query\ResultSetMapping $rsm)
{
@@ -320,10 +349,12 @@ class Configuration extends \Doctrine\DBAL\Configuration
/**
* Gets the components of a previously registered named native query.
*
- * @param string $name The name of the query.
+ * @param string $name The name of the query.
+ *
+ * @return array A tuple with the first element being the SQL string and the second
+ * element being the ResultSetMapping.
+ *
* @throws ORMException
- * @return array A tuple with the first element being the SQL string and the second
- * element being the ResultSetMapping.
*/
public function getNamedNativeQuery($name)
{
@@ -338,6 +369,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Ensures that this Configuration instance contains settings that are
* suitable for a production environment.
*
+ * @return void
+ *
* @throws ORMException If a configuration setting has a value that is not
* suitable for a production environment.
*/
@@ -365,6 +398,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
*
* @param string $name
* @param string $className
+ *
+ * @return void
+ *
* @throws ORMException
*/
public function addCustomStringFunction($name, $className)
@@ -380,7 +416,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Gets the implementation class name of a registered custom string DQL function.
*
* @param string $name
- * @return string
+ *
+ * @return string|null
*/
public function getCustomStringFunction($name)
{
@@ -400,6 +437,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Any previously added string functions are discarded.
*
* @param array $functions The map of custom DQL string functions.
+ *
+ * @return void
*/
public function setCustomStringFunctions(array $functions)
{
@@ -417,6 +456,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
*
* @param string $name
* @param string $className
+ *
+ * @return void
+ *
* @throws ORMException
*/
public function addCustomNumericFunction($name, $className)
@@ -432,7 +474,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Gets the implementation class name of a registered custom numeric DQL function.
*
* @param string $name
- * @return string
+ *
+ * @return string|null
*/
public function getCustomNumericFunction($name)
{
@@ -452,6 +495,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Any previously added numeric functions are discarded.
*
* @param array $functions The map of custom DQL numeric functions.
+ *
+ * @return void
*/
public function setCustomNumericFunctions(array $functions)
{
@@ -469,6 +514,9 @@ class Configuration extends \Doctrine\DBAL\Configuration
*
* @param string $name
* @param string $className
+ *
+ * @return void
+ *
* @throws ORMException
*/
public function addCustomDatetimeFunction($name, $className)
@@ -484,7 +532,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Gets the implementation class name of a registered custom date/time DQL function.
*
* @param string $name
- * @return string
+ *
+ * @return string|null
*/
public function getCustomDatetimeFunction($name)
{
@@ -504,6 +553,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Any previously added date/time functions are discarded.
*
* @param array $functions The map of custom DQL date/time functions.
+ *
+ * @return void
*/
public function setCustomDatetimeFunctions(array $functions)
{
@@ -513,9 +564,11 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set the custom hydrator modes in one pass.
+ * Sets the custom hydrator modes in one pass.
*
- * @param array An array of ($modeName => $hydrator)
+ * @param array $modes An array of ($modeName => $hydrator).
+ *
+ * @return void
*/
public function setCustomHydrationModes($modes)
{
@@ -527,10 +580,11 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Get the hydrator class for the given hydration mode name.
+ * Gets the hydrator class for the given hydration mode name.
*
* @param string $modeName The hydration mode name.
- * @return string $hydrator The hydrator class name.
+ *
+ * @return string|null The hydrator class name.
*/
public function getCustomHydrationMode($modeName)
{
@@ -540,10 +594,12 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Add a custom hydration mode.
+ * Adds a custom hydration mode.
*
* @param string $modeName The hydration mode name.
* @param string $hydrator The hydrator class name.
+ *
+ * @return void
*/
public function addCustomHydrationMode($modeName, $hydrator)
{
@@ -551,9 +607,11 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set a class metadata factory.
+ * Sets a class metadata factory.
*
* @param string $cmfName
+ *
+ * @return void
*/
public function setClassMetadataFactoryName($cmfName)
{
@@ -573,11 +631,12 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Add a filter to the list of possible filters.
+ * Adds a filter to the list of possible filters.
*
- * @param string $name The name of the filter.
- * @param string|Query\Filter\SQLFilter $filter The filter class name or an
- * SQLFilter instance.
+ * @param string $name The name of the filter.
+ * @param string|Query\Filter\SQLFilter $filter The filter class name or an SQLFilter instance.
+ *
+ * @return void
*
* @throws \InvalidArgumentException If the filter is an object and it doesn't
* extend the Query\Filter\SQLFilter class.
@@ -599,8 +658,8 @@ class Configuration extends \Doctrine\DBAL\Configuration
*
* @param string $name The name of the filter.
*
- * @return string|Query\Filter\SQLFilter The class name of the filter, an
- * SQLFilter instance or null of it is not defined.
+ * @return null|string|Query\Filter\SQLFilter The class name of the filter, an
+ * SQLFilter instance or null of it is not defined.
*/
public function getFilter($name)
{
@@ -610,10 +669,14 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set default repository class.
+ * Sets default repository class.
*
* @since 2.2
+ *
* @param string $className
+ *
+ * @return void
+ *
* @throws ORMException If not is a \Doctrine\Common\Persistence\ObjectRepository
*/
public function setDefaultRepositoryClassName($className)
@@ -631,6 +694,7 @@ class Configuration extends \Doctrine\DBAL\Configuration
* Get default repository class.
*
* @since 2.2
+ *
* @return string
*/
public function getDefaultRepositoryClassName()
@@ -641,10 +705,13 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set naming strategy.
+ * Sets naming strategy.
*
* @since 2.3
+ *
* @param NamingStrategy $namingStrategy
+ *
+ * @return void
*/
public function setNamingStrategy(NamingStrategy $namingStrategy)
{
@@ -652,9 +719,10 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Get naming strategy..
+ * Gets naming strategy..
*
* @since 2.3
+ *
* @return NamingStrategy
*/
public function getNamingStrategy()
@@ -667,10 +735,13 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Set quote strategy.
+ * Sets quote strategy.
*
* @since 2.3
+ *
* @param \Doctrine\ORM\Mapping\QuoteStrategy $quoteStrategy
+ *
+ * @return void
*/
public function setQuoteStrategy(QuoteStrategy $quoteStrategy)
{
@@ -678,9 +749,10 @@ class Configuration extends \Doctrine\DBAL\Configuration
}
/**
- * Get quote strategy.
+ * Gets quote strategy.
*
* @since 2.3
+ *
* @return \Doctrine\ORM\Mapping\QuoteStrategy
*/
public function getQuoteStrategy()
diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php
index 9a6974424..31366f865 100644
--- a/lib/Doctrine/ORM/EntityManager.php
+++ b/lib/Doctrine/ORM/EntityManager.php
@@ -123,8 +123,8 @@ class EntityManager implements ObjectManager
* Creates a new EntityManager that operates on the given database connection
* and uses the given Configuration and EventManager implementations.
*
- * @param \Doctrine\DBAL\Connection $conn
- * @param \Doctrine\ORM\Configuration $config
+ * @param \Doctrine\DBAL\Connection $conn
+ * @param \Doctrine\ORM\Configuration $config
* @param \Doctrine\Common\EventManager $eventManager
*/
protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
@@ -193,6 +193,8 @@ class EntityManager implements ObjectManager
/**
* Starts a transaction on the underlying database connection.
+ *
+ * @return void
*/
public function beginTransaction()
{
@@ -210,7 +212,8 @@ class EntityManager implements ObjectManager
* the transaction is rolled back, the EntityManager closed and the exception re-thrown.
*
* @param callable $func The function to execute transactionally.
- * @return mixed Returns the non-empty value returned from the closure or true instead
+ *
+ * @return mixed The non-empty value returned from the closure or true instead.
*/
public function transactional($func)
{
@@ -237,6 +240,8 @@ class EntityManager implements ObjectManager
/**
* Commits a transaction on the underlying database connection.
+ *
+ * @return void
*/
public function commit()
{
@@ -245,6 +250,8 @@ class EntityManager implements ObjectManager
/**
* Performs a rollback on the underlying database connection.
+ *
+ * @return void
*/
public function rollback()
{
@@ -261,7 +268,10 @@ class EntityManager implements ObjectManager
* MyProject\Domain\User
* sales:PriceRequest
*
+ * @param string $className
+ *
* @return \Doctrine\ORM\Mapping\ClassMetadata
+ *
* @internal Performance-sensitive method.
*/
public function getClassMetadata($className)
@@ -273,6 +283,7 @@ class EntityManager implements ObjectManager
* Creates a new Query object.
*
* @param string $dql The DQL string.
+ *
* @return \Doctrine\ORM\Query
*/
public function createQuery($dql = "")
@@ -290,6 +301,7 @@ class EntityManager implements ObjectManager
* Creates a Query from a named query.
*
* @param string $name
+ *
* @return \Doctrine\ORM\Query
*/
public function createNamedQuery($name)
@@ -300,8 +312,9 @@ class EntityManager implements ObjectManager
/**
* Creates a native SQL query.
*
- * @param string $sql
+ * @param string $sql
* @param ResultSetMapping $rsm The ResultSetMapping to use.
+ *
* @return NativeQuery
*/
public function createNativeQuery($sql, ResultSetMapping $rsm)
@@ -318,6 +331,7 @@ class EntityManager implements ObjectManager
* Creates a NativeQuery from a named native query.
*
* @param string $name
+ *
* @return \Doctrine\ORM\NativeQuery
*/
public function createNamedNativeQuery($name)
@@ -330,7 +344,7 @@ class EntityManager implements ObjectManager
/**
* Create a QueryBuilder instance
*
- * @return QueryBuilder $qb
+ * @return QueryBuilder
*/
public function createQueryBuilder()
{
@@ -346,6 +360,9 @@ class EntityManager implements ObjectManager
* the cascade-persist semantics + scheduled inserts/removals are synchronized.
*
* @param object $entity
+ *
+ * @return void
+ *
* @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
* makes use of optimistic locking fails.
*/
@@ -359,12 +376,17 @@ class EntityManager implements ObjectManager
/**
* Finds an Entity by its identifier.
*
- * @param string $entityName
- * @param mixed $id
+ * @param string $entityName
+ * @param mixed $id
* @param integer $lockMode
* @param integer $lockVersion
*
* @return object
+ *
+ * @throws OptimisticLockException
+ * @throws ORMInvalidArgumentException
+ * @throws TransactionRequiredException
+ * @throws ORMException
*/
public function find($entityName, $id, $lockMode = LockMode::NONE, $lockVersion = null)
{
@@ -446,8 +468,11 @@ class EntityManager implements ObjectManager
* without actually loading it, if the entity is not yet loaded.
*
* @param string $entityName The name of the entity type.
- * @param mixed $id The entity identifier.
+ * @param mixed $id The entity identifier.
+ *
* @return object The entity reference.
+ *
+ * @throws ORMException
*/
public function getReference($entityName, $id)
{
@@ -503,7 +528,8 @@ class EntityManager implements ObjectManager
* never be loaded in the first place.
*
* @param string $entityName The name of the entity type.
- * @param mixed $identifier The entity identifier.
+ * @param mixed $identifier The entity identifier.
+ *
* @return object The (partial) entity reference.
*/
public function getPartialReference($entityName, $identifier)
@@ -533,7 +559,9 @@ class EntityManager implements ObjectManager
* Clears the EntityManager. All entities that are currently managed
* by this EntityManager become detached.
*
- * @param string $entityName if given, only entities of this type will get detached
+ * @param string|null $entityName if given, only entities of this type will get detached
+ *
+ * @return void
*/
public function clear($entityName = null)
{
@@ -544,6 +572,8 @@ class EntityManager implements ObjectManager
* Closes the EntityManager. All entities that are currently managed
* by this EntityManager become detached. The EntityManager may no longer
* be used after it is closed.
+ *
+ * @return void
*/
public function close()
{
@@ -561,7 +591,11 @@ class EntityManager implements ObjectManager
* NOTE: The persist operation always considers entities that are not yet known to
* this EntityManager as NEW. Do not pass detached entities to the persist operation.
*
- * @param object $object The instance to make managed and persistent.
+ * @param object $entity The instance to make managed and persistent.
+ *
+ * @return void
+ *
+ * @throws ORMInvalidArgumentException
*/
public function persist($entity)
{
@@ -581,6 +615,10 @@ class EntityManager implements ObjectManager
* or as a result of the flush operation.
*
* @param object $entity The entity instance to remove.
+ *
+ * @return void
+ *
+ * @throws ORMInvalidArgumentException
*/
public function remove($entity)
{
@@ -598,6 +636,10 @@ class EntityManager implements ObjectManager
* overriding any local changes that have not yet been persisted.
*
* @param object $entity The entity to refresh.
+ *
+ * @return void
+ *
+ * @throws ORMInvalidArgumentException
*/
public function refresh($entity)
{
@@ -618,6 +660,10 @@ class EntityManager implements ObjectManager
* reference it.
*
* @param object $entity The entity to detach.
+ *
+ * @return void
+ *
+ * @throws ORMInvalidArgumentException
*/
public function detach($entity)
{
@@ -634,7 +680,10 @@ class EntityManager implements ObjectManager
* The entity passed to merge will not become associated/managed with this EntityManager.
*
* @param object $entity The detached entity to merge into the persistence context.
+ *
* @return object The managed copy of the entity.
+ *
+ * @throws ORMInvalidArgumentException
*/
public function merge($entity)
{
@@ -650,8 +699,13 @@ class EntityManager implements ObjectManager
/**
* Creates a copy of the given entity. Can create a shallow or a deep copy.
*
- * @param object $entity The entity to copy.
- * @return object The new entity.
+ * @param object $entity The entity to copy.
+ * @param boolean $deep FALSE for a shallow copy, TRUE for a deep copy.
+ *
+ * @return object The new entity.
+ *
+ * @throws \BadMethodCallException
+ *
* @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e:
* Fatal error: Maximum function nesting level of '100' reached, aborting!
*/
@@ -663,9 +717,12 @@ class EntityManager implements ObjectManager
/**
* Acquire a lock on the given entity.
*
- * @param object $entity
- * @param int $lockMode
- * @param int $lockVersion
+ * @param object $entity
+ * @param int $lockMode
+ * @param int|null $lockVersion
+ *
+ * @return void
+ *
* @throws OptimisticLockException
* @throws PessimisticLockException
*/
@@ -678,6 +735,7 @@ class EntityManager implements ObjectManager
* Gets the repository for an entity class.
*
* @param string $entityName The name of the entity.
+ *
* @return EntityRepository The repository class.
*/
public function getRepository($entityName)
@@ -706,6 +764,7 @@ class EntityManager implements ObjectManager
* Determines whether an entity instance is managed in this EntityManager.
*
* @param object $entity
+ *
* @return boolean TRUE if this EntityManager currently manages the given entity, FALSE otherwise.
*/
public function contains($entity)
@@ -738,6 +797,8 @@ class EntityManager implements ObjectManager
/**
* Throws an exception if the EntityManager is closed or currently not active.
*
+ * @return void
+ *
* @throws ORMException If the EntityManager is closed.
*/
private function errorIfClosed()
@@ -774,6 +835,7 @@ class EntityManager implements ObjectManager
* selectively iterate over the result.
*
* @param int $hydrationMode
+ *
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/
public function getHydrator($hydrationMode)
@@ -788,8 +850,11 @@ class EntityManager implements ObjectManager
/**
* Create a new instance for the given hydration mode.
*
- * @param int $hydrationMode
+ * @param int $hydrationMode
+ *
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
+ *
+ * @throws ORMException
*/
public function newHydrator($hydrationMode)
{
@@ -834,6 +899,8 @@ class EntityManager implements ObjectManager
* This method is a no-op for other objects
*
* @param object $obj
+ *
+ * @return void
*/
public function initializeObject($obj)
{
@@ -843,11 +910,14 @@ class EntityManager implements ObjectManager
/**
* Factory method to create EntityManager instances.
*
- * @param mixed $conn An array with the connection parameters or an existing
- * Connection instance.
- * @param Configuration $config The Configuration instance to use.
- * @param EventManager $eventManager The EventManager instance to use.
+ * @param mixed $conn An array with the connection parameters or an existing Connection instance.
+ * @param Configuration $config The Configuration instance to use.
+ * @param EventManager $eventManager The EventManager instance to use.
+ *
* @return EntityManager The created EntityManager.
+ *
+ * @throws \InvalidArgumentException
+ * @throws ORMException
*/
public static function create($conn, Configuration $config, EventManager $eventManager = null)
{
@@ -902,7 +972,7 @@ class EntityManager implements ObjectManager
/**
* Checks whether the Entity Manager has filters.
*
- * @return True, if the EM has a filter collection.
+ * @return boolean True, if the EM has a filter collection.
*/
public function hasFilters()
{
diff --git a/lib/Doctrine/ORM/EntityNotFoundException.php b/lib/Doctrine/ORM/EntityNotFoundException.php
index 087c65d91..710853deb 100644
--- a/lib/Doctrine/ORM/EntityNotFoundException.php
+++ b/lib/Doctrine/ORM/EntityNotFoundException.php
@@ -27,6 +27,9 @@ namespace Doctrine\ORM;
*/
class EntityNotFoundException extends ORMException
{
+ /**
+ * Constructor.
+ */
public function __construct()
{
parent::__construct('Entity was not found.');
diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php
index c3d548bb6..8520208c9 100644
--- a/lib/Doctrine/ORM/EntityRepository.php
+++ b/lib/Doctrine/ORM/EntityRepository.php
@@ -61,8 +61,8 @@ class EntityRepository implements ObjectRepository, Selectable
/**
* Initializes a new EntityRepository.
*
- * @param EntityManager $em The EntityManager to use.
- * @param Mapping\ClassMetadata $classMetadata The class descriptor.
+ * @param EntityManager $em The EntityManager to use.
+ * @param Mapping\ClassMetadata $class The class descriptor.
*/
public function __construct($em, Mapping\ClassMetadata $class)
{
@@ -72,10 +72,11 @@ class EntityRepository implements ObjectRepository, Selectable
}
/**
- * Create a new QueryBuilder instance that is prepopulated for this entity name
+ * Creates a new QueryBuilder instance that is prepopulated for this entity name.
*
* @param string $alias
- * @return QueryBuilder $qb
+ *
+ * @return QueryBuilder
*/
public function createQueryBuilder($alias)
{
@@ -85,11 +86,12 @@ class EntityRepository implements ObjectRepository, Selectable
}
/**
- * Create a new result set mapping builder for this entity.
+ * Creates a new result set mapping builder for this entity.
*
* The column naming strategy is "INCREMENT".
*
* @param string $alias
+ *
* @return ResultSetMappingBuilder
*/
public function createResultSetMappingBuilder($alias)
@@ -101,9 +103,10 @@ class EntityRepository implements ObjectRepository, Selectable
}
/**
- * Create a new Query instance based on a predefined metadata named query.
+ * Creates a new Query instance based on a predefined metadata named query.
*
* @param string $queryName
+ *
* @return Query
*/
public function createNamedQuery($queryName)
@@ -115,6 +118,7 @@ class EntityRepository implements ObjectRepository, Selectable
* Creates a native SQL query.
*
* @param string $queryName
+ *
* @return NativeQuery
*/
public function createNativeNamedQuery($queryName)
@@ -128,6 +132,8 @@ class EntityRepository implements ObjectRepository, Selectable
/**
* Clears the repository, causing all managed entities to become detached.
+ *
+ * @return void
*/
public function clear()
{
@@ -137,9 +143,9 @@ class EntityRepository implements ObjectRepository, Selectable
/**
* Finds an entity by its primary key / identifier.
*
- * @param mixed $id The identifier.
- * @param integer $lockMode
- * @param integer $lockVersion
+ * @param mixed $id The identifier.
+ * @param int $lockMode The lock mode.
+ * @param int|null $lockVersion The lock version.
*
* @return object The entity.
*/
@@ -161,10 +167,11 @@ class EntityRepository implements ObjectRepository, Selectable
/**
* Finds entities by a set of criteria.
*
- * @param array $criteria
+ * @param array $criteria
* @param array|null $orderBy
- * @param int|null $limit
- * @param int|null $offset
+ * @param int|null $limit
+ * @param int|null $offset
+ *
* @return array The objects.
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
@@ -179,6 +186,7 @@ class EntityRepository implements ObjectRepository, Selectable
*
* @param array $criteria
* @param array|null $orderBy
+ *
* @return object
*/
public function findOneBy(array $criteria, array $orderBy = null)
@@ -191,8 +199,13 @@ class EntityRepository implements ObjectRepository, Selectable
/**
* Adds support for magic finders.
*
+ * @param string $method
+ * @param array $arguments
+ *
* @return array|object The found entity/entities.
- * @throws BadMethodCallException If the method called is an invalid find* method
+ *
+ * @throws ORMException
+ * @throws \BadMethodCallException If the method called is an invalid find* method
* or no find* method at all and therefore an invalid
* method call.
*/
@@ -291,4 +304,3 @@ class EntityRepository implements ObjectRepository, Selectable
return new ArrayCollection($persister->loadCriteria($criteria));
}
}
-
diff --git a/lib/Doctrine/ORM/Event/LifecycleEventArgs.php b/lib/Doctrine/ORM/Event/LifecycleEventArgs.php
index 4346054b7..57aa51427 100644
--- a/lib/Doctrine/ORM/Event/LifecycleEventArgs.php
+++ b/lib/Doctrine/ORM/Event/LifecycleEventArgs.php
@@ -44,10 +44,10 @@ class LifecycleEventArgs extends EventArgs
private $entity;
/**
- * Constructor
+ * Constructor.
*
- * @param object $entity
- * @param \Doctrine\ORM\EntityManager $em
+ * @param object $entity
+ * @param EntityManager $em
*/
public function __construct($entity, EntityManager $em)
{
@@ -56,7 +56,7 @@ class LifecycleEventArgs extends EventArgs
}
/**
- * Retrieve associated Entity.
+ * Retrieves associated Entity.
*
* @return object
*/
@@ -66,7 +66,7 @@ class LifecycleEventArgs extends EventArgs
}
/**
- * Retrieve associated EntityManager.
+ * Retrieves associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
diff --git a/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php b/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
index 4c2cb0748..8396f0d24 100644
--- a/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
+++ b/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php
@@ -44,8 +44,8 @@ class LoadClassMetadataEventArgs extends EventArgs
/**
* Constructor.
*
- * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata
- * @param \Doctrine\ORM\EntityManager $em
+ * @param ClassMetadataInfo $classMetadata
+ * @param EntityManager $em
*/
public function __construct(ClassMetadataInfo $classMetadata, EntityManager $em)
{
@@ -54,7 +54,7 @@ class LoadClassMetadataEventArgs extends EventArgs
}
/**
- * Retrieve associated ClassMetadata.
+ * Retrieves associated ClassMetadata.
*
* @return \Doctrine\ORM\Mapping\ClassMetadataInfo
*/
@@ -64,7 +64,7 @@ class LoadClassMetadataEventArgs extends EventArgs
}
/**
- * Retrieve associated EntityManager.
+ * Retrieves associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
@@ -73,4 +73,3 @@ class LoadClassMetadataEventArgs extends EventArgs
return $this->em;
}
}
-
diff --git a/lib/Doctrine/ORM/Event/OnClearEventArgs.php b/lib/Doctrine/ORM/Event/OnClearEventArgs.php
index 309994f3d..23520ed2a 100644
--- a/lib/Doctrine/ORM/Event/OnClearEventArgs.php
+++ b/lib/Doctrine/ORM/Event/OnClearEventArgs.php
@@ -44,7 +44,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
* Constructor.
*
* @param \Doctrine\ORM\EntityManager $em
- * @param string $entityClass Optional entity class
+ * @param string|null $entityClass Optional entity class.
*/
public function __construct($em, $entityClass = null)
{
@@ -53,7 +53,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
}
/**
- * Retrieve associated EntityManager.
+ * Retrieves associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
@@ -65,7 +65,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
/**
* Name of the entity class that is cleared, or empty if all are cleared.
*
- * @return string
+ * @return string|null
*/
public function getEntityClass()
{
@@ -73,7 +73,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
}
/**
- * Check if event clears all entities.
+ * Checks if event clears all entities.
*
* @return bool
*/
diff --git a/lib/Doctrine/ORM/Event/PostFlushEventArgs.php b/lib/Doctrine/ORM/Event/PostFlushEventArgs.php
index 5f9735c0e..d12060082 100644
--- a/lib/Doctrine/ORM/Event/PostFlushEventArgs.php
+++ b/lib/Doctrine/ORM/Event/PostFlushEventArgs.php
@@ -47,7 +47,7 @@ class PostFlushEventArgs extends EventArgs
}
/**
- * Retrieve associated EntityManager.
+ * Retrieves associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
diff --git a/lib/Doctrine/ORM/Event/PreFlushEventArgs.php b/lib/Doctrine/ORM/Event/PreFlushEventArgs.php
index c59f5db70..02798e1a3 100644
--- a/lib/Doctrine/ORM/Event/PreFlushEventArgs.php
+++ b/lib/Doctrine/ORM/Event/PreFlushEventArgs.php
@@ -35,6 +35,11 @@ class PreFlushEventArgs extends \Doctrine\Common\EventArgs
*/
private $_em;
+ /**
+ * Constructor.
+ *
+ * @param \Doctrine\ORM\EntityManager $em
+ */
public function __construct($em)
{
$this->_em = $em;
diff --git a/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php b/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
index 1bb0f1b77..0cae066af 100644
--- a/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
+++ b/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
@@ -40,9 +40,9 @@ class PreUpdateEventArgs extends LifecycleEventArgs
/**
* Constructor.
*
- * @param object $entity
- * @param \Doctrine\ORM\EntityManager $em
- * @param array $changeSet
+ * @param object $entity
+ * @param EntityManager $em
+ * @param array $changeSet
*/
public function __construct($entity, EntityManager $em, array &$changeSet)
{
@@ -52,7 +52,7 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Retrieve entity changeset.
+ * Retrieves entity changeset.
*
* @return array
*/
@@ -62,7 +62,9 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Check if field has a changeset.
+ * Checks if field has a changeset.
+ *
+ * @param string $field
*
* @return boolean
*/
@@ -72,9 +74,10 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Get the old value of the changeset of the changed field.
+ * Gets the old value of the changeset of the changed field.
+ *
+ * @param string $field
*
- * @param string $field
* @return mixed
*/
public function getOldValue($field)
@@ -85,9 +88,10 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Get the new value of the changeset of the changed field.
+ * Gets the new value of the changeset of the changed field.
+ *
+ * @param string $field
*
- * @param string $field
* @return mixed
*/
public function getNewValue($field)
@@ -98,10 +102,12 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Set the new value of this field.
+ * Sets the new value of this field.
*
* @param string $field
- * @param mixed $value
+ * @param mixed $value
+ *
+ * @return void
*/
public function setNewValue($field, $value)
{
@@ -111,9 +117,13 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
/**
- * Assert the field exists in changeset.
+ * Asserts the field exists in changeset.
*
* @param string $field
+ *
+ * @return void
+ *
+ * @throws \InvalidArgumentException
*/
private function assertValidField($field)
{
@@ -126,4 +136,3 @@ class PreUpdateEventArgs extends LifecycleEventArgs
}
}
}
-
diff --git a/lib/Doctrine/ORM/Events.php b/lib/Doctrine/ORM/Events.php
index 812a43eab..28fdcd9a9 100644
--- a/lib/Doctrine/ORM/Events.php
+++ b/lib/Doctrine/ORM/Events.php
@@ -29,7 +29,13 @@ namespace Doctrine\ORM;
*/
final class Events
{
- private function __construct() {}
+ /**
+ * Private constructor. This class is not meant to be instantiated.
+ */
+ private function __construct()
+ {
+ }
+
/**
* The preRemove event occurs for a given entity before the respective
* EntityManager remove operation for that entity is executed.
@@ -39,6 +45,7 @@ final class Events
* @var string
*/
const preRemove = 'preRemove';
+
/**
* The postRemove event occurs for an entity after the entity has
* been deleted. It will be invoked after the database delete operations.
@@ -48,6 +55,7 @@ final class Events
* @var string
*/
const postRemove = 'postRemove';
+
/**
* The prePersist event occurs for a given entity before the respective
* EntityManager persist operation for that entity is executed.
@@ -57,6 +65,7 @@ final class Events
* @var string
*/
const prePersist = 'prePersist';
+
/**
* The postPersist event occurs for an entity after the entity has
* been made persistent. It will be invoked after the database insert operations.
@@ -67,6 +76,7 @@ final class Events
* @var string
*/
const postPersist = 'postPersist';
+
/**
* The preUpdate event occurs before the database update operations to
* entity data.
@@ -76,6 +86,7 @@ final class Events
* @var string
*/
const preUpdate = 'preUpdate';
+
/**
* The postUpdate event occurs after the database update operations to
* entity data.
@@ -85,6 +96,7 @@ final class Events
* @var string
*/
const postUpdate = 'postUpdate';
+
/**
* The postLoad event occurs for an entity after the entity has been loaded
* into the current EntityManager from the database or after the refresh operation
@@ -99,6 +111,7 @@ final class Events
* @var string
*/
const postLoad = 'postLoad';
+
/**
* The loadClassMetadata event occurs after the mapping metadata for a class
* has been loaded from a mapping source (annotations/xml/yaml).
diff --git a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php
index 77f6b0022..b4161b29e 100644
--- a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php
+++ b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php
@@ -26,7 +26,9 @@ abstract class AbstractIdGenerator
/**
* Generates an identifier for an entity.
*
+ * @param \Doctrine\ORM\EntityManager $em
* @param \Doctrine\ORM\Mapping\Entity $entity
+ *
* @return mixed
*/
abstract public function generate(EntityManager $em, $entity);
diff --git a/lib/Doctrine/ORM/Id/AssignedGenerator.php b/lib/Doctrine/ORM/Id/AssignedGenerator.php
index 0597c3bc6..853ff3bbd 100644
--- a/lib/Doctrine/ORM/Id/AssignedGenerator.php
+++ b/lib/Doctrine/ORM/Id/AssignedGenerator.php
@@ -36,8 +36,13 @@ class AssignedGenerator extends AbstractIdGenerator
/**
* Returns the identifier assigned to the given entity.
*
- * @param object $entity
+ * @param EntityManager $em
+ * @param object $entity
+ *
* @return mixed
+ *
+ * @throws \Doctrine\ORM\ORMException
+ *
* @override
*/
public function generate(EntityManager $em, $entity)
diff --git a/lib/Doctrine/ORM/Id/IdentityGenerator.php b/lib/Doctrine/ORM/Id/IdentityGenerator.php
index ff2cd01b1..014bb44b4 100644
--- a/lib/Doctrine/ORM/Id/IdentityGenerator.php
+++ b/lib/Doctrine/ORM/Id/IdentityGenerator.php
@@ -28,13 +28,19 @@ use Doctrine\ORM\EntityManager;
*/
class IdentityGenerator extends AbstractIdGenerator
{
- /** @var string The name of the sequence to pass to lastInsertId(), if any. */
+ /**
+ * The name of the sequence to pass to lastInsertId(), if any.
+ *
+ * @var string
+ */
private $_seqName;
/**
- * @param string $seqName The name of the sequence to pass to lastInsertId()
- * to obtain the last generated identifier within the current
- * database session/connection, if any.
+ * Constructor.
+ *
+ * @param string|null $seqName The name of the sequence to pass to lastInsertId()
+ * to obtain the last generated identifier within the current
+ * database session/connection, if any.
*/
public function __construct($seqName = null)
{
diff --git a/lib/Doctrine/ORM/Id/SequenceGenerator.php b/lib/Doctrine/ORM/Id/SequenceGenerator.php
index d230e3c6d..545152254 100644
--- a/lib/Doctrine/ORM/Id/SequenceGenerator.php
+++ b/lib/Doctrine/ORM/Id/SequenceGenerator.php
@@ -30,16 +30,34 @@ use Doctrine\ORM\EntityManager;
*/
class SequenceGenerator extends AbstractIdGenerator implements Serializable
{
+ /**
+ * The allocation size of the sequence.
+ *
+ * @var int
+ */
private $_allocationSize;
+
+ /**
+ * The name of the sequence.
+ *
+ * @var string
+ */
private $_sequenceName;
+
+ /**
+ * @var int
+ */
private $_nextValue = 0;
+
+ /**
+ * @var int|null
+ */
private $_maxValue = null;
/**
* Initializes a new sequence generator.
*
- * @param \Doctrine\ORM\EntityManager $em The EntityManager to use.
- * @param string $sequenceName The name of the sequence.
+ * @param string $sequenceName The name of the sequence.
* @param integer $allocationSize The allocation size of the sequence.
*/
public function __construct($sequenceName, $allocationSize)
@@ -51,8 +69,11 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
/**
* Generates an ID for the given entity.
*
- * @param object $entity
- * @return integer|float The generated value.
+ * @param EntityManager $em
+ * @param object $entity
+ *
+ * @return integer The generated value.
+ *
* @override
*/
public function generate(EntityManager $em, $entity)
@@ -72,7 +93,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
/**
* Gets the maximum value of the currently allocated bag of values.
*
- * @return integer|float
+ * @return integer|null
*/
public function getCurrentMaxValue()
{
@@ -82,13 +103,16 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
/**
* Gets the next value that will be returned by generate().
*
- * @return integer|float
+ * @return integer
*/
public function getNextValue()
{
return $this->_nextValue;
}
+ /**
+ * @return string
+ */
public function serialize()
{
return serialize(array(
@@ -97,6 +121,11 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
));
}
+ /**
+ * @param string $serialized
+ *
+ * @return void
+ */
public function unserialize($serialized)
{
$array = unserialize($serialized);
diff --git a/lib/Doctrine/ORM/Id/TableGenerator.php b/lib/Doctrine/ORM/Id/TableGenerator.php
index 7e84b0a6b..34606fb22 100644
--- a/lib/Doctrine/ORM/Id/TableGenerator.php
+++ b/lib/Doctrine/ORM/Id/TableGenerator.php
@@ -32,12 +32,36 @@ use Doctrine\ORM\EntityManager;
*/
class TableGenerator extends AbstractIdGenerator
{
+ /**
+ * @var string
+ */
private $_tableName;
+
+ /**
+ * @var string
+ */
private $_sequenceName;
+
+ /**
+ * @var int
+ */
private $_allocationSize;
+
+ /**
+ * @var int|null
+ */
private $_nextValue;
+
+ /**
+ * @var int|null
+ */
private $_maxValue;
+ /**
+ * @param string $tableName
+ * @param string $sequenceName
+ * @param int $allocationSize
+ */
public function __construct($tableName, $sequenceName = 'default', $allocationSize = 10)
{
$this->_tableName = $tableName;
@@ -45,6 +69,9 @@ class TableGenerator extends AbstractIdGenerator
$this->_allocationSize = $allocationSize;
}
+ /**
+ * {@inheritdoc}
+ */
public function generate(EntityManager $em, $entity)
{
if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) {
diff --git a/lib/Doctrine/ORM/Id/UuidGenerator.php b/lib/Doctrine/ORM/Id/UuidGenerator.php
index 230c518fe..901af806a 100644
--- a/lib/Doctrine/ORM/Id/UuidGenerator.php
+++ b/lib/Doctrine/ORM/Id/UuidGenerator.php
@@ -19,7 +19,6 @@
namespace Doctrine\ORM\Id;
-use Serializable;
use Doctrine\ORM\EntityManager;
/**
@@ -30,13 +29,14 @@ use Doctrine\ORM\EntityManager;
*/
class UuidGenerator extends AbstractIdGenerator
{
-
/**
* Generates an ID for the given entity.
*
- * @param Doctrine\ORM\EntityManager $em The EntityManager to user
- * @param object $entity
+ * @param EntityManager $em The EntityManager to use.
+ * @param object $entity
+ *
* @return string The generated value.
+ *
* @override
*/
public function generate(EntityManager $em, $entity)
@@ -45,5 +45,4 @@ class UuidGenerator extends AbstractIdGenerator
$sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression();
return $conn->query($sql)->fetchColumn(0);
}
-
}
diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
index a4ae5f3e0..b5153e6d3 100644
--- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
+++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
@@ -33,9 +33,26 @@ class CommitOrderCalculator
const IN_PROGRESS = 2;
const VISITED = 3;
+ /**
+ * @var array
+ */
private $_nodeStates = array();
- private $_classes = array(); // The nodes to sort
+
+ /**
+ * The nodes to sort.
+ *
+ * @var array
+ */
+ private $_classes = array();
+
+ /**
+ * @var array
+ */
private $_relatedClasses = array();
+
+ /**
+ * @var array
+ */
private $_sorted = array();
/**
@@ -85,6 +102,11 @@ class CommitOrderCalculator
return $sorted;
}
+ /**
+ * @param \Doctrine\ORM\Mapping\ClassMetadata $node
+ *
+ * @return void
+ */
private function _visitNode($node)
{
$this->_nodeStates[$node->name] = self::IN_PROGRESS;
@@ -101,16 +123,32 @@ class CommitOrderCalculator
$this->_sorted[] = $node;
}
+ /**
+ * @param \Doctrine\ORM\Mapping\ClassMetadata $fromClass
+ * @param \Doctrine\ORM\Mapping\ClassMetadata $toClass
+ *
+ * @return void
+ */
public function addDependency($fromClass, $toClass)
{
$this->_relatedClasses[$fromClass->name][] = $toClass;
}
+ /**
+ * @param string $className
+ *
+ * @return bool
+ */
public function hasClass($className)
{
return isset($this->_classes[$className]);
}
+ /**
+ * @param \Doctrine\ORM\Mapping\ClassMetadata $class
+ *
+ * @return void
+ */
public function addClass($class)
{
$this->_classes[$class->name] = $class;
diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
index b64024e7f..1254bacb4 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
@@ -20,7 +20,6 @@
namespace Doctrine\ORM\Internal\Hydration;
use PDO;
-use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Events;
@@ -37,25 +36,53 @@ use Doctrine\ORM\Mapping\ClassMetadata;
*/
abstract class AbstractHydrator
{
- /** @var \Doctrine\ORM\Query\ResultSetMapping The ResultSetMapping. */
+ /**
+ * The ResultSetMapping.
+ *
+ * @var \Doctrine\ORM\Query\ResultSetMapping
+ */
protected $_rsm;
- /** @var EntityManager The EntityManager instance. */
+ /**
+ * The EntityManager instance.
+ *
+ * @var EntityManager
+ */
protected $_em;
- /** @var \Doctrine\DBAL\Platforms\AbstractPlatform The dbms Platform instance */
+ /**
+ * The dbms Platform instance.
+ *
+ * @var \Doctrine\DBAL\Platforms\AbstractPlatform
+ */
protected $_platform;
- /** @var \Doctrine\ORM\UnitOfWork The UnitOfWork of the associated EntityManager. */
+ /**
+ * The UnitOfWork of the associated EntityManager.
+ *
+ * @var \Doctrine\ORM\UnitOfWork
+ */
protected $_uow;
- /** @var array The cache used during row-by-row hydration. */
+ /**
+ * The cache used during row-by-row hydration.
+ *
+ * @var array
+ */
protected $_cache = array();
- /** @var \Doctrine\DBAL\Driver\Statement The statement that provides the data to hydrate. */
+ /**
+ * The statement that provides the data to hydrate.
+ *
+ * @var \Doctrine\DBAL\Driver\Statement
+ */
protected $_stmt;
- /** @var array The query hints. */
+ /**
+ * The query hints.
+ *
+ * @var array
+ */
protected $_hints;
/**
@@ -75,6 +102,7 @@ abstract class AbstractHydrator
*
* @param object $stmt
* @param object $resultSetMapping
+ * @param array $hints
*
* @return IterableResult
*/
@@ -97,8 +125,9 @@ abstract class AbstractHydrator
*
* @param object $stmt
* @param object $resultSetMapping
- * @param array $hints
- * @return mixed
+ * @param array $hints
+ *
+ * @return array
*/
public function hydrateAll($stmt, $resultSetMapping, array $hints = array())
{
@@ -141,13 +170,18 @@ abstract class AbstractHydrator
/**
* Excutes one-time preparation tasks, once each time hydration is started
* through {@link hydrateAll} or {@link iterate()}.
+ *
+ * @return void
*/
protected function prepare()
- {}
+ {
+ }
/**
* Excutes one-time cleanup tasks at the end of a hydration that was initiated
* through {@link hydrateAll} or {@link iterate()}.
+ *
+ * @return void
*/
protected function cleanup()
{
@@ -162,9 +196,13 @@ abstract class AbstractHydrator
*
* Template method.
*
- * @param array $data The row data.
- * @param array $cache The cache to use.
- * @param mixed $result The result to fill.
+ * @param array $data The row data.
+ * @param array $cache The cache to use.
+ * @param array $result The result to fill.
+ *
+ * @return void
+ *
+ * @throws HydrationException
*/
protected function hydrateRowData(array $data, array &$cache, array &$result)
{
@@ -173,6 +211,8 @@ abstract class AbstractHydrator
/**
* Hydrates all rows from the current statement instance at once.
+ *
+ * @return array
*/
abstract protected function hydrateAllData();
@@ -185,9 +225,9 @@ abstract class AbstractHydrator
* field names during this procedure as well as any necessary conversions on
* the values applied. Scalar values are kept in a specfic key 'scalars'.
*
- * @param array $data SQL Result Row
- * @param array &$cache Cache for column to field result information
- * @param array &$id Dql-Alias => ID-Hash
+ * @param array $data SQL Result Row.
+ * @param array &$cache Cache for column to field result information.
+ * @param array &$id Dql-Alias => ID-Hash.
* @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value?
*
* @return array An array with all the fields (name => value) of the data row,
@@ -371,9 +411,11 @@ abstract class AbstractHydrator
/**
* Register entity as managed in UnitOfWork.
*
- * @param \Doctrine\ORM\Mapping\ClassMetadata $class
- * @param object $entity
- * @param array $data
+ * @param ClassMetadata $class
+ * @param object $entity
+ * @param array $data
+ *
+ * @return void
*
* @todo The "$id" generation is the same of UnitOfWork#createEntity. Remove this duplication somehow
*/
@@ -402,6 +444,10 @@ abstract class AbstractHydrator
/**
* When executed in a hydrate() loop we have to clear internal state to
* decrease memory consumption.
+ *
+ * @param mixed $eventArgs
+ *
+ * @return void
*/
public function onClear($eventArgs)
{
diff --git a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
index 3f9d8d15b..bb18f32c6 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php
@@ -20,7 +20,6 @@
namespace Doctrine\ORM\Internal\Hydration;
use PDO;
-use Doctrine\DBAL\Connection;
use Doctrine\ORM\Mapping\ClassMetadata;
/**
@@ -33,12 +32,39 @@ use Doctrine\ORM\Mapping\ClassMetadata;
*/
class ArrayHydrator extends AbstractHydrator
{
+ /**
+ * @var array
+ */
private $_ce = array();
+
+ /**
+ * @var array
+ */
private $_rootAliases = array();
+
+ /**
+ * @var bool
+ */
private $_isSimpleQuery = false;
+
+ /**
+ * @var array
+ */
private $_identifierMap = array();
+
+ /**
+ * @var array
+ */
private $_resultPointers = array();
+
+ /**
+ * @var array
+ */
private $_idTemplate = array();
+
+ /**
+ * @var int
+ */
private $_resultCounter = 0;
/**
@@ -238,10 +264,12 @@ class ArrayHydrator extends AbstractHydrator
* Updates the result pointer for an Entity. The result pointers point to the
* last seen instance of each Entity type. This is used for graph construction.
*
- * @param array $coll The element.
- * @param boolean|integer $index Index of the element in the collection.
- * @param string $dqlAlias
- * @param boolean $oneToOne Whether it is a single-valued association or not.
+ * @param array $coll The element.
+ * @param boolean|integer $index Index of the element in the collection.
+ * @param string $dqlAlias
+ * @param boolean $oneToOne Whether it is a single-valued association or not.
+ *
+ * @return void
*/
private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
{
diff --git a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php
index 2d78742b0..496942e94 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php
@@ -21,17 +21,31 @@ namespace Doctrine\ORM\Internal\Hydration;
class HydrationException extends \Doctrine\ORM\ORMException
{
+ /**
+ * @return HydrationException
+ */
public static function nonUniqueResult()
{
return new self("The result returned by the query was not unique.");
}
+ /**
+ * @param string $alias
+ * @param string $parentAlias
+ *
+ * @return HydrationException
+ */
public static function parentObjectOfRelationNotFound($alias, $parentAlias)
{
return new self("The parent object of entity result with alias '$alias' was not found."
. " The parent alias is '$parentAlias'.");
}
+ /**
+ * @param string $dqlAlias
+ *
+ * @return HydrationException
+ */
public static function emptyDiscriminatorValue($dqlAlias)
{
return new self("The DQL alias '" . $dqlAlias . "' contains an entity ".
@@ -43,10 +57,12 @@ class HydrationException extends \Doctrine\ORM\ORMException
/**
* @since 2.3
- * @param string $entityName
- * @param string $discrColumnName
- * @param string $dqlAlias
- * @return HydrationException
+ *
+ * @param string $entityName
+ * @param string $discrColumnName
+ * @param string $dqlAlias
+ *
+ * @return HydrationException
*/
public static function missingDiscriminatorColumn($entityName, $discrColumnName, $dqlAlias)
{
@@ -58,10 +74,12 @@ class HydrationException extends \Doctrine\ORM\ORMException
/**
* @since 2.3
- * @param string $entityName
- * @param string $discrColumnName
- * @param string $dqlAlias
- * @return HydrationException
+ *
+ * @param string $entityName
+ * @param string $discrColumnName
+ * @param string $dqlAlias
+ *
+ * @return HydrationException
*/
public static function missingDiscriminatorMetaMappingColumn($entityName, $discrColumnName, $dqlAlias)
{
@@ -70,4 +88,4 @@ class HydrationException extends \Doctrine\ORM\ORMException
$discrColumnName, $entityName, $dqlAlias
));
}
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php b/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php
index d04fe0e84..3bbf6724d 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php
@@ -44,7 +44,7 @@ class IterableResult implements \Iterator
private $_key = -1;
/**
- * @var object
+ * @var object|null
*/
private $_current = null;
@@ -56,6 +56,11 @@ class IterableResult implements \Iterator
$this->_hydrator = $hydrator;
}
+ /**
+ * @return void
+ *
+ * @throws HydrationException
+ */
public function rewind()
{
if ($this->_rewinded == true) {
diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
index 1dd18566e..bc28aa072 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
@@ -38,8 +38,11 @@ use Doctrine\ORM\Proxy\Proxy;
*/
class ObjectHydrator extends AbstractHydrator
{
- /* Local ClassMetadata cache to avoid going to the EntityManager all the time.
+ /**
+ * Local ClassMetadata cache to avoid going to the EntityManager all the time.
* This local cache is maintained between hydration runs and not cleared.
+ *
+ * @var array
*/
private $ce = array();
@@ -80,7 +83,6 @@ class ObjectHydrator extends AbstractHydrator
*/
private $existingCollections = array();
-
/**
* {@inheritdoc}
*/
@@ -191,6 +193,8 @@ class ObjectHydrator extends AbstractHydrator
* @param ClassMetadata $class
* @param string $fieldName The name of the field on the entity that holds the collection.
* @param string $parentDqlAlias Alias of the parent fetch joining this collection.
+ *
+ * @return \Doctrine\ORM\PersistentCollection
*/
private function initRelatedCollection($entity, $class, $fieldName, $parentDqlAlias)
{
@@ -236,7 +240,10 @@ class ObjectHydrator extends AbstractHydrator
*
* @param array $data The instance data.
* @param string $dqlAlias The DQL alias of the entity's class.
+ *
* @return object The entity.
+ *
+ * @throws HydrationException
*/
private function getEntity(array $data, $dqlAlias)
{
@@ -275,6 +282,7 @@ class ObjectHydrator extends AbstractHydrator
/**
* @param string $className
* @param array $data
+ *
* @return mixed
*/
private function getEntityFromIdentityMap($className, array $data)
@@ -306,6 +314,7 @@ class ObjectHydrator extends AbstractHydrator
* local cache.
*
* @param string $className The name of the class.
+ *
* @return ClassMetadata
*/
private function getClassMetadata($className)
@@ -337,6 +346,8 @@ class ObjectHydrator extends AbstractHydrator
* @param array $row The data of the row to process.
* @param array $cache The cache to use.
* @param array $result The result array to fill.
+ *
+ * @return void
*/
protected function hydrateRowData(array $row, array &$cache, array &$result)
{
@@ -593,12 +604,15 @@ class ObjectHydrator extends AbstractHydrator
$result[$resultKey][$objIndex] = $obj;
}
}
-
}
/**
* When executed in a hydrate() loop we may have to clear internal state to
* decrease memory consumption.
+ *
+ * @param mixed $eventArgs
+ *
+ * @return void
*/
public function onClear($eventArgs)
{
diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
index b9c6693aa..abd29e76f 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
@@ -19,11 +19,9 @@
namespace Doctrine\ORM\Internal\Hydration;
-use \PDO;
+use PDO;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\ClassMetadata;
-use Doctrine\ORM\Event\LifecycleEventArgs;
-use Doctrine\ORM\Events;
use Doctrine\ORM\Query;
class SimpleObjectHydrator extends AbstractHydrator
diff --git a/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
index 20d563fdb..b94724176 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php
@@ -19,7 +19,6 @@
namespace Doctrine\ORM\Internal\Hydration;
-use Doctrine\DBAL\Connection;
use Doctrine\ORM\NoResultException;
use Doctrine\ORM\NonUniqueResultException;
diff --git a/lib/Doctrine/ORM/Mapping/AssociationOverride.php b/lib/Doctrine/ORM/Mapping/AssociationOverride.php
index 8776be67a..1a9a31f18 100644
--- a/lib/Doctrine/ORM/Mapping/AssociationOverride.php
+++ b/lib/Doctrine/ORM/Mapping/AssociationOverride.php
@@ -30,9 +30,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class AssociationOverride implements Annotation
{
-
/**
- * The name of the relationship property whose mapping is being overridden
+ * The name of the relationship property whose mapping is being overridden.
*
* @var string
*/
@@ -45,12 +44,10 @@ final class AssociationOverride implements Annotation
*/
public $joinColumns;
-
/**
* The join table that maps the relationship.
*
* @var \Doctrine\ORM\Mapping\JoinTable
*/
public $joinTable;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/AssociationOverrides.php b/lib/Doctrine/ORM/Mapping/AssociationOverrides.php
index b0a0c1393..217c9e457 100644
--- a/lib/Doctrine/ORM/Mapping/AssociationOverrides.php
+++ b/lib/Doctrine/ORM/Mapping/AssociationOverrides.php
@@ -30,12 +30,10 @@ namespace Doctrine\ORM\Mapping;
*/
final class AssociationOverrides implements Annotation
{
-
/**
- * Mapping overrides of relationship properties
+ * Mapping overrides of relationship properties.
*
* @var array<\Doctrine\ORM\Mapping\AssociationOverride>
*/
public $value;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/AttributeOverride.php b/lib/Doctrine/ORM/Mapping/AttributeOverride.php
index ef9e6dd89..f86d3a152 100644
--- a/lib/Doctrine/ORM/Mapping/AttributeOverride.php
+++ b/lib/Doctrine/ORM/Mapping/AttributeOverride.php
@@ -30,7 +30,6 @@ namespace Doctrine\ORM\Mapping;
*/
final class AttributeOverride implements Annotation
{
-
/**
* The name of the property whose mapping is being overridden.
*
diff --git a/lib/Doctrine/ORM/Mapping/AttributeOverrides.php b/lib/Doctrine/ORM/Mapping/AttributeOverrides.php
index 41f680d6a..63b2cc66e 100644
--- a/lib/Doctrine/ORM/Mapping/AttributeOverrides.php
+++ b/lib/Doctrine/ORM/Mapping/AttributeOverrides.php
@@ -30,12 +30,10 @@ namespace Doctrine\ORM\Mapping;
*/
final class AttributeOverrides implements Annotation
{
-
/**
* One or more field or property mapping overrides.
*
* @var array<\Doctrine\ORM\Mapping\AttributeOverride>
*/
public $value;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php
index 7701d3e07..93179a406 100644
--- a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php
+++ b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php
@@ -34,19 +34,19 @@ class AssociationBuilder
protected $mapping;
/**
- * @var array
+ * @var array|null
*/
protected $joinColumns;
/**
- *
* @var int
*/
protected $type;
/**
* @param ClassMetadataBuilder $builder
- * @param array $mapping
+ * @param array $mapping
+ * @param int $type
*/
public function __construct(ClassMetadataBuilder $builder, array $mapping, $type)
{
@@ -55,66 +55,103 @@ class AssociationBuilder
$this->type = $type;
}
+ /**
+ * @param string $fieldName
+ *
+ * @return AssociationBuilder
+ */
public function mappedBy($fieldName)
{
$this->mapping['mappedBy'] = $fieldName;
return $this;
}
+ /**
+ * @param string $fieldName
+ *
+ * @return AssociationBuilder
+ */
public function inversedBy($fieldName)
{
$this->mapping['inversedBy'] = $fieldName;
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadeAll()
{
$this->mapping['cascade'] = array("ALL");
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadePersist()
{
$this->mapping['cascade'][] = "persist";
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadeRemove()
{
$this->mapping['cascade'][] = "remove";
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadeMerge()
{
$this->mapping['cascade'][] = "merge";
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadeDetach()
{
$this->mapping['cascade'][] = "detach";
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function cascadeRefresh()
{
$this->mapping['cascade'][] = "refresh";
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function fetchExtraLazy()
{
$this->mapping['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY;
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function fetchEager()
{
$this->mapping['fetch'] = ClassMetadata::FETCH_EAGER;
return $this;
}
+ /**
+ * @return AssociationBuilder
+ */
public function fetchLazy()
{
$this->mapping['fetch'] = ClassMetadata::FETCH_LAZY;
@@ -122,14 +159,16 @@ class AssociationBuilder
}
/**
- * Add Join Columns
+ * Add Join Columns.
*
- * @param string $columnName
- * @param string $referencedColumnName
- * @param bool $nullable
- * @param bool $unique
- * @param string $onDelete
- * @param string $columnDef
+ * @param string $columnName
+ * @param string $referencedColumnName
+ * @param bool $nullable
+ * @param bool $unique
+ * @param string|null $onDelete
+ * @param string|null $columnDef
+ *
+ * @return AssociationBuilder
*/
public function addJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
{
@@ -146,6 +185,8 @@ class AssociationBuilder
/**
* @return ClassMetadataBuilder
+ *
+ * @throws \InvalidArgumentException
*/
public function build()
{
diff --git a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php
index 07c3e81d8..a634f1678 100644
--- a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php
+++ b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php
@@ -55,7 +55,7 @@ class ClassMetadataBuilder
}
/**
- * Mark the class as mapped superclass.
+ * Marks the class as mapped superclass.
*
* @return ClassMetadataBuilder
*/
@@ -67,9 +67,10 @@ class ClassMetadataBuilder
}
/**
- * Set custom Repository class name
+ * Sets custom Repository class name.
*
* @param string $repositoryClassName
+ *
* @return ClassMetadataBuilder
*/
public function setCustomRepositoryClass($repositoryClassName)
@@ -80,7 +81,7 @@ class ClassMetadataBuilder
}
/**
- * Mark class read only
+ * Marks class read only.
*
* @return ClassMetadataBuilder
*/
@@ -92,9 +93,10 @@ class ClassMetadataBuilder
}
/**
- * Set the table name
+ * Sets the table name.
*
* @param string $name
+ *
* @return ClassMetadataBuilder
*/
public function setTable($name)
@@ -105,10 +107,11 @@ class ClassMetadataBuilder
}
/**
- * Add Index
+ * Adds Index.
*
- * @param array $columns
+ * @param array $columns
* @param string $name
+ *
* @return ClassMetadataBuilder
*/
public function addIndex(array $columns, $name)
@@ -123,10 +126,11 @@ class ClassMetadataBuilder
}
/**
- * Add Unique Constraint
+ * Adds Unique Constraint.
*
- * @param array $columns
+ * @param array $columns
* @param string $name
+ *
* @return ClassMetadataBuilder
*/
public function addUniqueConstraint(array $columns, $name)
@@ -141,10 +145,11 @@ class ClassMetadataBuilder
}
/**
- * Add named query
+ * Adds named query.
*
* @param string $name
* @param string $dqlQuery
+ *
* @return ClassMetadataBuilder
*/
public function addNamedQuery($name, $dqlQuery)
@@ -158,7 +163,7 @@ class ClassMetadataBuilder
}
/**
- * Set class as root of a joined table inheritance hierachy.
+ * Sets class as root of a joined table inheritance hierachy.
*
* @return ClassMetadataBuilder
*/
@@ -170,7 +175,7 @@ class ClassMetadataBuilder
}
/**
- * Set class as root of a single table inheritance hierachy.
+ * Sets class as root of a single table inheritance hierachy.
*
* @return ClassMetadataBuilder
*/
@@ -182,10 +187,13 @@ class ClassMetadataBuilder
}
/**
- * Set the discriminator column details.
+ * Sets the discriminator column details.
*
* @param string $name
* @param string $type
+ * @param int $length
+ *
+ * @return ClassMetadataBuilder
*/
public function setDiscriminatorColumn($name, $type = 'string', $length = 255)
{
@@ -199,10 +207,11 @@ class ClassMetadataBuilder
}
/**
- * Add a subclass to this inheritance hierachy.
+ * Adds a subclass to this inheritance hierachy.
*
* @param string $name
* @param string $class
+ *
* @return ClassMetadataBuilder
*/
public function addDiscriminatorMapClass($name, $class)
@@ -213,7 +222,7 @@ class ClassMetadataBuilder
}
/**
- * Set deferred explicit change tracking policy.
+ * Sets deferred explicit change tracking policy.
*
* @return ClassMetadataBuilder
*/
@@ -225,7 +234,7 @@ class ClassMetadataBuilder
}
/**
- * Set notify change tracking policy.
+ * Sets notify change tracking policy.
*
* @return ClassMetadataBuilder
*/
@@ -237,10 +246,11 @@ class ClassMetadataBuilder
}
/**
- * Add lifecycle event
+ * Adds lifecycle event.
*
* @param string $methodName
* @param string $event
+ *
* @return ClassMetadataBuilder
*/
public function addLifecycleEvent($methodName, $event)
@@ -251,11 +261,13 @@ class ClassMetadataBuilder
}
/**
- * Add Field
+ * Adds Field.
*
* @param string $name
* @param string $type
- * @param array $mapping
+ * @param array $mapping
+ *
+ * @return ClassMetadataBuilder
*/
public function addField($name, $type, array $mapping = array())
{
@@ -268,10 +280,11 @@ class ClassMetadataBuilder
}
/**
- * Create a field builder.
+ * Creates a field builder.
*
* @param string $name
* @param string $type
+ *
* @return FieldBuilder
*/
public function createField($name, $type)
@@ -286,11 +299,12 @@ class ClassMetadataBuilder
}
/**
- * Add a simple many to one association, optionally with the inversed by field.
+ * Adds a simple many to one association, optionally with the inversed by field.
*
- * @param string $name
- * @param string $targetEntity
+ * @param string $name
+ * @param string $targetEntity
* @param string|null $inversedBy
+ *
* @return ClassMetadataBuilder
*/
public function addManyToOne($name, $targetEntity, $inversedBy = null)
@@ -305,12 +319,13 @@ class ClassMetadataBuilder
}
/**
- * Create a ManyToOne Assocation Builder.
+ * Creates a ManyToOne Assocation Builder.
*
* Note: This method does not add the association, you have to call build() on the AssociationBuilder.
*
* @param string $name
* @param string $targetEntity
+ *
* @return AssociationBuilder
*/
public function createManyToOne($name, $targetEntity)
@@ -326,10 +341,11 @@ class ClassMetadataBuilder
}
/**
- * Create OneToOne Assocation Builder
+ * Creates a OneToOne Association Builder.
*
* @param string $name
* @param string $targetEntity
+ *
* @return AssociationBuilder
*/
public function createOneToOne($name, $targetEntity)
@@ -345,11 +361,12 @@ class ClassMetadataBuilder
}
/**
- * Add simple inverse one-to-one assocation.
+ * Adds simple inverse one-to-one assocation.
*
* @param string $name
* @param string $targetEntity
* @param string $mappedBy
+ *
* @return ClassMetadataBuilder
*/
public function addInverseOneToOne($name, $targetEntity, $mappedBy)
@@ -361,11 +378,12 @@ class ClassMetadataBuilder
}
/**
- * Add simple owning one-to-one assocation.
+ * Adds simple owning one-to-one assocation.
+ *
+ * @param string $name
+ * @param string $targetEntity
+ * @param string|null $inversedBy
*
- * @param string $name
- * @param string $targetEntity
- * @param string $inversedBy
* @return ClassMetadataBuilder
*/
public function addOwningOneToOne($name, $targetEntity, $inversedBy = null)
@@ -380,10 +398,11 @@ class ClassMetadataBuilder
}
/**
- * Create ManyToMany Assocation Builder
+ * Creates a ManyToMany Assocation Builder.
*
* @param string $name
* @param string $targetEntity
+ *
* @return ManyToManyAssociationBuilder
*/
public function createManyToMany($name, $targetEntity)
@@ -399,11 +418,12 @@ class ClassMetadataBuilder
}
/**
- * Add a simple owning many to many assocation.
+ * Adds a simple owning many to many assocation.
*
- * @param string $name
- * @param string $targetEntity
+ * @param string $name
+ * @param string $targetEntity
* @param string|null $inversedBy
+ *
* @return ClassMetadataBuilder
*/
public function addOwningManyToMany($name, $targetEntity, $inversedBy = null)
@@ -418,11 +438,12 @@ class ClassMetadataBuilder
}
/**
- * Add a simple inverse many to many assocation.
+ * Adds a simple inverse many to many assocation.
*
* @param string $name
* @param string $targetEntity
* @param string $mappedBy
+ *
* @return ClassMetadataBuilder
*/
public function addInverseManyToMany($name, $targetEntity, $mappedBy)
@@ -434,10 +455,11 @@ class ClassMetadataBuilder
}
/**
- * Create a one to many assocation builder
+ * Creates a one to many assocation builder.
*
* @param string $name
* @param string $targetEntity
+ *
* @return OneToManyAssociationBuilder
*/
public function createOneToMany($name, $targetEntity)
@@ -453,11 +475,12 @@ class ClassMetadataBuilder
}
/**
- * Add simple OneToMany assocation.
+ * Adds simple OneToMany assocation.
*
* @param string $name
* @param string $targetEntity
* @param string $mappedBy
+ *
* @return ClassMetadataBuilder
*/
public function addOneToMany($name, $targetEntity, $mappedBy)
diff --git a/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php
index 7029e14ce..a4eb8cced 100644
--- a/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php
+++ b/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php
@@ -33,10 +33,12 @@ class FieldBuilder
* @var ClassMetadataBuilder
*/
private $builder;
+
/**
* @var array
*/
private $mapping;
+
/**
* @var bool
*/
@@ -53,9 +55,8 @@ class FieldBuilder
private $sequenceDef;
/**
- *
* @param ClassMetadataBuilder $builder
- * @param array $mapping
+ * @param array $mapping
*/
public function __construct(ClassMetadataBuilder $builder, array $mapping)
{
@@ -64,9 +65,10 @@ class FieldBuilder
}
/**
- * Set length.
+ * Sets length.
*
* @param int $length
+ *
* @return FieldBuilder
*/
public function length($length)
@@ -76,9 +78,10 @@ class FieldBuilder
}
/**
- * Set nullable
+ * Sets nullable.
+ *
+ * @param bool $flag
*
- * @param bool
* @return FieldBuilder
*/
public function nullable($flag = true)
@@ -88,9 +91,10 @@ class FieldBuilder
}
/**
- * Set Unique
+ * Sets Unique.
+ *
+ * @param bool $flag
*
- * @param bool
* @return FieldBuilder
*/
public function unique($flag = true)
@@ -100,9 +104,10 @@ class FieldBuilder
}
/**
- * Set column name
+ * Sets column name.
*
* @param string $name
+ *
* @return FieldBuilder
*/
public function columnName($name)
@@ -112,9 +117,10 @@ class FieldBuilder
}
/**
- * Set Precision
+ * Sets Precision.
+ *
+ * @param int $p
*
- * @param int $p
* @return FieldBuilder
*/
public function precision($p)
@@ -124,9 +130,10 @@ class FieldBuilder
}
/**
- * Set scale.
+ * Sets scale.
*
* @param int $s
+ *
* @return FieldBuilder
*/
public function scale($s)
@@ -136,7 +143,7 @@ class FieldBuilder
}
/**
- * Set field as primary key.
+ * Sets field as primary key.
*
* @return FieldBuilder
*/
@@ -147,7 +154,8 @@ class FieldBuilder
}
/**
- * @param int $strategy
+ * @param string $strategy
+ *
* @return FieldBuilder
*/
public function generatedValue($strategy = 'AUTO')
@@ -157,7 +165,7 @@ class FieldBuilder
}
/**
- * Set field versioned
+ * Sets field versioned.
*
* @return FieldBuilder
*/
@@ -168,11 +176,12 @@ class FieldBuilder
}
/**
- * Set Sequence Generator
+ * Sets Sequence Generator.
*
* @param string $sequenceName
- * @param int $allocationSize
- * @param int $initialValue
+ * @param int $allocationSize
+ * @param int $initialValue
+ *
* @return FieldBuilder
*/
public function setSequenceGenerator($sequenceName, $allocationSize = 1, $initialValue = 1)
@@ -186,9 +195,10 @@ class FieldBuilder
}
/**
- * Set column definition.
+ * Sets column definition.
*
* @param string $def
+ *
* @return FieldBuilder
*/
public function columnDefinition($def)
@@ -198,7 +208,7 @@ class FieldBuilder
}
/**
- * Finalize this field and attach it to the ClassMetadata.
+ * Finalizes this field and attach it to the ClassMetadata.
*
* Without this call a FieldBuilder has no effect on the ClassMetadata.
*
diff --git a/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php
index 61f862a7e..0dc0af487 100644
--- a/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php
+++ b/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php
@@ -29,10 +29,21 @@ namespace Doctrine\ORM\Mapping\Builder;
*/
class ManyToManyAssociationBuilder extends OneToManyAssociationBuilder
{
+ /**
+ * @var string|null
+ */
private $joinTableName;
+ /**
+ * @var array
+ */
private $inverseJoinColumns = array();
+ /**
+ * @param string $name
+ *
+ * @return ManyToManyAssociationBuilder
+ */
public function setJoinTable($name)
{
$this->joinTableName = $name;
@@ -40,14 +51,16 @@ class ManyToManyAssociationBuilder extends OneToManyAssociationBuilder
}
/**
- * Add Inverse Join Columns
+ * Adds Inverse Join Columns.
*
- * @param string $columnName
- * @param string $referencedColumnName
- * @param bool $nullable
- * @param bool $unique
- * @param string $onDelete
- * @param string $columnDef
+ * @param string $columnName
+ * @param string $referencedColumnName
+ * @param bool $nullable
+ * @param bool $unique
+ * @param string|null $onDelete
+ * @param string|null $columnDef
+ *
+ * @return ManyToManyAssociationBuilder
*/
public function addInverseJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null)
{
diff --git a/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php
index dbaf65c81..d8f4c3953 100644
--- a/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php
+++ b/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php
@@ -31,6 +31,7 @@ class OneToManyAssociationBuilder extends AssociationBuilder
{
/**
* @param array $fieldNames
+ *
* @return OneToManyAssociationBuilder
*/
public function setOrderBy(array $fieldNames)
@@ -39,6 +40,11 @@ class OneToManyAssociationBuilder extends AssociationBuilder
return $this;
}
+ /**
+ * @param string $fieldName
+ *
+ * @return OneToManyAssociationBuilder
+ */
public function setIndexBy($fieldName)
{
$this->mapping['indexBy'] = $fieldName;
diff --git a/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php b/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php
index d8a75015b..3657b764f 100644
--- a/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php
+++ b/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php
@@ -26,7 +26,9 @@ namespace Doctrine\ORM\Mapping;
final class ChangeTrackingPolicy implements Annotation
{
/**
- * @var string The change tracking policy.
+ * The change tracking policy.
+ *
+ * @var string
*
* @Enum({"DEFERRED_IMPLICIT", "DEFERRED_EXPLICIT", "NOTIFY"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
index 5dc63e6ac..b5fb39f1b 100644
--- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
+++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
@@ -173,8 +173,11 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
/**
* Validate runtime metadata is correctly defined.
*
- * @param ClassMetadata $class
- * @param $parent
+ * @param ClassMetadata $class
+ * @param ClassMetadataInterface|null $parent
+ *
+ * @return void
+ *
* @throws MappingException
*/
protected function validateRuntimeMetadata($class, $parent)
@@ -226,6 +229,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
* each class as key.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
+ *
* @throws MappingException
*/
private function addDefaultDiscriminatorMap(ClassMetadata $class)
@@ -255,9 +259,10 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
}
/**
- * Get the lower-case short name of a class.
+ * Gets the lower-case short name of a class.
*
* @param string $className
+ *
* @return string
*/
private function getShortName($className)
@@ -275,6 +280,8 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass
+ *
+ * @return void
*/
private function addInheritedFields(ClassMetadata $subClass, ClassMetadata $parentClass)
{
@@ -297,6 +304,9 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass
+ *
+ * @return void
+ *
* @throws MappingException
*/
private function addInheritedRelations(ClassMetadata $subClass, ClassMetadata $parentClass)
@@ -324,8 +334,11 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
* Adds inherited named queries to the subclass mapping.
*
* @since 2.2
+ *
* @param \Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass
+ *
+ * @return void
*/
private function addInheritedNamedQueries(ClassMetadata $subClass, ClassMetadata $parentClass)
{
@@ -343,8 +356,11 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
* Adds inherited named native queries to the subclass mapping.
*
* @since 2.3
+ *
* @param \Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass
+ *
+ * @return void
*/
private function addInheritedNamedNativeQueries(ClassMetadata $subClass, ClassMetadata $parentClass)
{
@@ -365,8 +381,11 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
* Adds inherited sql result set mappings to the subclass mapping.
*
* @since 2.3
+ *
* @param \Doctrine\ORM\Mapping\ClassMetadata $subClass
* @param \Doctrine\ORM\Mapping\ClassMetadata $parentClass
+ *
+ * @return void
*/
private function addInheritedSqlResultSetMappings(ClassMetadata $subClass, ClassMetadata $parentClass)
{
@@ -396,6 +415,9 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
* most appropriate for the targeted database platform.
*
* @param ClassMetadataInfo $class
+ *
+ * @return void
+ *
* @throws ORMException
*/
private function completeIdGeneratorMapping(ClassMetadataInfo $class)
diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
index 96271c52f..a9dfa9b8c 100644
--- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
+++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
@@ -29,7 +29,7 @@ use Doctrine\Common\ClassLoader;
/**
* A ClassMetadata instance holds all the object-relational mapping metadata
- * of an entity and it's associations.
+ * of an entity and its associations.
*
* Once populated, ClassMetadata instances are usually cached in a serialized form.
*
@@ -111,10 +111,12 @@ class ClassMetadataInfo implements ClassMetadata
* portability is currently not guaranteed.
*/
const GENERATOR_TYPE_UUID = 6;
+
/**
* CUSTOM means that customer will use own ID generator that supposedly work
*/
const GENERATOR_TYPE_CUSTOM = 7;
+
/**
* DEFERRED_IMPLICIT means that changes of entities are calculated at commit-time
* by doing a property-by-property comparison with the original data. This will
@@ -188,6 +190,8 @@ class ClassMetadataInfo implements ClassMetadata
/**
* READ-ONLY: The name of the entity class.
+ *
+ * @var string
*/
public $name;
@@ -195,6 +199,7 @@ class ClassMetadataInfo implements ClassMetadata
* READ-ONLY: The namespace the entity class is contained in.
*
* @var string
+ *
* @todo Not really needed. Usage could be localized.
*/
public $namespace;
@@ -220,6 +225,7 @@ class ClassMetadataInfo implements ClassMetadata
*
*
* @var array
+ *
* @todo Merge with tableGeneratorDefinition into generic generatorDefinition
*/
public $customGeneratorDefinition;
@@ -272,6 +278,8 @@ class ClassMetadataInfo implements ClassMetadata
* 'resultSetMapping' =>
* )
*
+ *
+ * @var array
*/
public $namedNativeQueries = array();
@@ -286,6 +294,8 @@ class ClassMetadataInfo implements ClassMetadata
* 'columns' => array()
* )
*
+ *
+ * @var array
*/
public $sqlResultSetMappings = array();
@@ -307,7 +317,7 @@ class ClassMetadataInfo implements ClassMetadata
/**
* READ-ONLY: The Id generator type used by the class.
*
- * @var string
+ * @var int
*/
public $generatorType = self::GENERATOR_TYPE_NONE;
@@ -369,6 +379,7 @@ class ClassMetadataInfo implements ClassMetadata
* This is the reverse lookup map of $_fieldNames.
*
* @var array
+ *
* @todo We could get rid of this array by just using $fieldMappings[$fieldName]['columnName'].
*/
public $columnNames = array();
@@ -380,6 +391,7 @@ class ClassMetadataInfo implements ClassMetadata
* where a discriminator column is used.
*
* @var mixed
+ *
* @see discriminatorColumn
*/
public $discriminatorValue;
@@ -391,6 +403,7 @@ class ClassMetadataInfo implements ClassMetadata
* where a discriminator column is used.
*
* @var mixed
+ *
* @see discriminatorColumn
*/
public $discriminatorMap = array();
@@ -476,7 +489,6 @@ class ClassMetadataInfo implements ClassMetadata
* )
*
*
- *
* @var array
*/
public $associationMappings = array();
@@ -501,6 +513,7 @@ class ClassMetadataInfo implements ClassMetadata
* READ-ONLY: The ID generator used for generating IDs for this class.
*
* @var \Doctrine\ORM\Id\AbstractIdGenerator
+ *
* @todo Remove!
*/
public $idGenerator;
@@ -519,6 +532,7 @@ class ClassMetadataInfo implements ClassMetadata
*
*
* @var array
+ *
* @todo Merge with tableGeneratorDefinition into generic generatorDefinition
*/
public $sequenceGeneratorDefinition;
@@ -528,6 +542,7 @@ class ClassMetadataInfo implements ClassMetadata
* TABLE generation strategy.
*
* @var array
+ *
* @todo Merge with tableGeneratorDefinition into generic generatorDefinition
*/
public $tableGeneratorDefinition;
@@ -543,14 +558,14 @@ class ClassMetadataInfo implements ClassMetadata
* READ-ONLY: A flag for whether or not instances of this class are to be versioned
* with optimistic locking.
*
- * @var boolean $isVersioned
+ * @var boolean
*/
public $isVersioned;
/**
* READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any).
*
- * @var mixed $versionField
+ * @var mixed
*/
public $versionField;
@@ -573,7 +588,7 @@ class ClassMetadataInfo implements ClassMetadata
public $isReadOnly = false;
/**
- * NamingStrategy determining the default column and table names
+ * NamingStrategy determining the default column and table names.
*
* @var \Doctrine\ORM\Mapping\NamingStrategy
*/
@@ -597,8 +612,8 @@ class ClassMetadataInfo implements ClassMetadata
* Initializes a new ClassMetadata instance that will hold the object-relational mapping
* metadata of the class with the given name.
*
- * @param string $entityName The name of the entity class the new instance is used for.
- * @param NamingStrategy $namingStrategy
+ * @param string $entityName The name of the entity class the new instance is used for.
+ * @param NamingStrategy|null $namingStrategy
*/
public function __construct($entityName, NamingStrategy $namingStrategy = null)
{
@@ -621,6 +636,7 @@ class ClassMetadataInfo implements ClassMetadata
* Gets a ReflectionProperty for a specific field of the mapped class.
*
* @param string $name
+ *
* @return \ReflectionProperty
*/
public function getReflectionProperty($name)
@@ -632,6 +648,7 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the ReflectionProperty for the single identifier field.
*
* @return \ReflectionProperty
+ *
* @throws BadMethodCallException If the class has a composite identifier.
*/
public function getSingleIdReflectionProperty()
@@ -649,6 +666,7 @@ class ClassMetadataInfo implements ClassMetadata
* with the same order as the field order in {@link identifier}.
*
* @param object $entity
+ *
* @return array
*/
public function getIdentifierValues($entity)
@@ -680,7 +698,10 @@ class ClassMetadataInfo implements ClassMetadata
* Populates the entity identifier of an entity.
*
* @param object $entity
- * @param mixed $id
+ * @param mixed $id
+ *
+ * @return void
+ *
* @todo Rename to assignIdentifier()
*/
public function setIdentifierValues($entity, array $id)
@@ -695,7 +716,9 @@ class ClassMetadataInfo implements ClassMetadata
*
* @param object $entity
* @param string $field
- * @param mixed $value
+ * @param mixed $value
+ *
+ * @return void
*/
public function setFieldValue($entity, $field, $value)
{
@@ -707,6 +730,8 @@ class ClassMetadataInfo implements ClassMetadata
*
* @param object $entity
* @param string $field
+ *
+ * @return mixed
*/
public function getFieldValue($entity, $field)
{
@@ -717,6 +742,7 @@ class ClassMetadataInfo implements ClassMetadata
* Creates a string representation of this instance.
*
* @return string The string representation of this instance.
+ *
* @todo Construct meaningful string representation.
*/
public function __toString()
@@ -836,6 +862,7 @@ class ClassMetadataInfo implements ClassMetadata
* Restores some state that can not be serialized/unserialized.
*
* @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService
+ *
* @return void
*/
public function wakeupReflection($reflService)
@@ -861,6 +888,8 @@ class ClassMetadataInfo implements ClassMetadata
* metadata of the class with the given name.
*
* @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service.
+ *
+ * @return void
*/
public function initializeReflection($reflService)
{
@@ -875,10 +904,11 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Validate Identifier
+ * Validates Identifier.
+ *
+ * @return void
*
* @throws MappingException
- * @return void
*/
public function validateIdentifier()
{
@@ -893,10 +923,11 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Validate association targets actually exist.
+ * Validates association targets actually exist.
+ *
+ * @return void
*
* @throws MappingException
- * @return void
*/
public function validateAssocations()
{
@@ -908,11 +939,13 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Validate lifecycle callbacks
+ * Validates lifecycle callbacks.
*
* @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function validateLifecycleCallbacks($reflService)
{
@@ -937,6 +970,8 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the change tracking policy used by this class.
*
* @param integer $policy
+ *
+ * @return void
*/
public function setChangeTrackingPolicy($policy)
{
@@ -976,9 +1011,10 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Checks whether a field is part of the identifier/primary key field(s).
*
- * @param string $fieldName The field name
- * @return boolean TRUE if the field is part of the table identifier/primary key field(s),
- * FALSE otherwise.
+ * @param string $fieldName The field name.
+ *
+ * @return boolean TRUE if the field is part of the table identifier/primary key field(s),
+ * FALSE otherwise.
*/
public function isIdentifier($fieldName)
{
@@ -989,10 +1025,11 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Check if the field is unique.
+ * Checks if the field is unique.
*
- * @param string $fieldName The field name
- * @return boolean TRUE if the field is unique, FALSE otherwise.
+ * @param string $fieldName The field name.
+ *
+ * @return boolean TRUE if the field is unique, FALSE otherwise.
*/
public function isUniqueField($fieldName)
{
@@ -1004,10 +1041,11 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Check if the field is not null.
+ * Checks if the field is not null.
*
- * @param string $fieldName The field name
- * @return boolean TRUE if the field is not null, FALSE otherwise.
+ * @param string $fieldName The field name.
+ *
+ * @return boolean TRUE if the field is not null, FALSE otherwise.
*/
public function isNullable($fieldName)
{
@@ -1024,7 +1062,8 @@ class ClassMetadataInfo implements ClassMetadata
* is returned.
*
* @param string $fieldName The field name.
- * @return string The column name.
+ *
+ * @return string The column name.
*/
public function getColumnName($fieldName)
{
@@ -1036,9 +1075,11 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the mapping of a (regular) field that holds some data but not a
* reference to another object.
*
- * @param string $fieldName The field name.
- * @throws MappingException
+ * @param string $fieldName The field name.
+ *
* @return array The field mapping.
+ *
+ * @throws MappingException
*/
public function getFieldMapping($fieldName)
{
@@ -1052,10 +1093,13 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the mapping of an association.
*
* @see ClassMetadataInfo::$associationMappings
- * @param string $fieldName The field name that represents the association in
- * the object model.
- * @throws MappingException
+ *
+ * @param string $fieldName The field name that represents the association in
+ * the object model.
+ *
* @return array The mapping.
+ *
+ * @throws MappingException
*/
public function getAssociationMapping($fieldName)
{
@@ -1079,8 +1123,9 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the field name for a column name.
* If no field name can be found the column name is returned.
*
- * @param string $columnName column name
- * @return string column alias
+ * @param string $columnName The column name.
+ *
+ * @return string The column alias.
*/
public function getFieldName($columnName)
{
@@ -1092,9 +1137,12 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the named query.
*
* @see ClassMetadataInfo::$namedQueries
- * @throws MappingException
- * @param string $queryName The query name
+ *
+ * @param string $queryName The query name.
+ *
* @return string
+ *
+ * @throws MappingException
*/
public function getNamedQuery($queryName)
{
@@ -1118,9 +1166,12 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the named native query.
*
* @see ClassMetadataInfo::$namedNativeQueries
- * @throws MappingException
- * @param string $queryName The query name
- * @return array
+ *
+ * @param string $queryName The query name.
+ *
+ * @return array
+ *
+ * @throws MappingException
*/
public function getNamedNativeQuery($queryName)
{
@@ -1145,9 +1196,12 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the result set mapping.
*
* @see ClassMetadataInfo::$sqlResultSetMappings
- * @throws MappingException
- * @param string $name The result set mapping name
- * @return array
+ *
+ * @param string $name The result set mapping name.
+ *
+ * @return array
+ *
+ * @throws MappingException
*/
public function getSqlResultSetMapping($name)
{
@@ -1171,9 +1225,11 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Validates & completes the given field mapping.
*
- * @param array $mapping The field mapping to validated & complete.
- * @throws MappingException
+ * @param array $mapping The field mapping to validate & complete.
+ *
* @return array The validated and completed field mapping.
+ *
+ * @throws MappingException
*/
protected function _validateAndCompleteFieldMapping(array &$mapping)
{
@@ -1232,7 +1288,9 @@ class ClassMetadataInfo implements ClassMetadata
* association mappings (one-to-one, many-ot-one, one-to-many, many-to-many).
*
* @param array $mapping The mapping.
+ *
* @return array The updated mapping.
+ *
* @throws MappingException If something is wrong with the mapping.
*/
protected function _validateAndCompleteAssociationMapping(array $mapping)
@@ -1349,10 +1407,12 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Validates & completes a one-to-one association mapping.
*
- * @param array $mapping The mapping to validate & complete.
+ * @param array $mapping The mapping to validate & complete.
+ *
+ * @return array The validated & completed mapping.
+ *
* @throws RuntimeException
* @throws MappingException
- * @return array The validated & completed mapping.@override
*/
protected function _validateAndCompleteOneToOneMapping(array $mapping)
{
@@ -1429,12 +1489,14 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Validates and completes the mapping.
+ * Validates & completes a one-to-many association mapping.
*
* @param array $mapping The mapping to validate and complete.
+ *
+ * @return array The validated and completed mapping.
+ *
* @throws MappingException
* @throws InvalidArgumentException
- * @return array The validated and completed mapping.@override
*/
protected function _validateAndCompleteOneToManyMapping(array $mapping)
{
@@ -1457,6 +1519,15 @@ class ClassMetadataInfo implements ClassMetadata
return $mapping;
}
+ /**
+ * Validates & completes a many-to-many association mapping.
+ *
+ * @param array $mapping The mapping to validate & complete.
+ *
+ * @return array The validated & completed mapping.
+ *
+ * @throws \InvalidArgumentException
+ */
protected function _validateAndCompleteManyToManyMapping(array $mapping)
{
$mapping = $this->_validateAndCompleteAssociationMapping($mapping);
@@ -1560,6 +1631,7 @@ class ClassMetadataInfo implements ClassMetadata
* entity classes that have a single-field pk.
*
* @return string
+ *
* @throws MappingException If the class has a composite primary key.
*/
public function getSingleIdentifierFieldName()
@@ -1575,6 +1647,7 @@ class ClassMetadataInfo implements ClassMetadata
* entity classes that have a single-field pk.
*
* @return string
+ *
* @throws MappingException If the class has a composite primary key.
*/
public function getSingleIdentifierColumnName()
@@ -1588,6 +1661,8 @@ class ClassMetadataInfo implements ClassMetadata
* Mainly used by the ClassMetadataFactory to assign inherited identifiers.
*
* @param array $identifier
+ *
+ * @return void
*/
public function setIdentifier(array $identifier)
{
@@ -1598,7 +1673,7 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Gets the mapped identifier field of this class.
*
- * @return array|string $identifier
+ * @return array|string
*/
public function getIdentifier()
{
@@ -1616,7 +1691,8 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Gets an array containing all the column names.
*
- * @param array $fieldNames
+ * @param array|null $fieldNames
+ *
* @return array
*/
public function getColumnNames(array $fieldNames = null)
@@ -1660,6 +1736,10 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Sets the type of Id generator to use for the mapped class.
+ *
+ * @param int $generatorType
+ *
+ * @return void
*/
public function setIdGeneratorType($generatorType)
{
@@ -1740,7 +1820,7 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Checks whether the class uses a table for id generation.
*
- * @return boolean TRUE if the class uses the TABLE generator, FALSE otherwise.
+ * @return boolean TRUE if the class uses the TABLE generator, FALSE otherwise.
*/
public function isIdGeneratorTable()
{
@@ -1759,7 +1839,7 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Checks whether the class use a UUID for id generation
+ * Checks whether the class use a UUID for id generation.
*
* @return boolean
*/
@@ -1772,7 +1852,8 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the type of a field.
*
* @param string $fieldName
- * @return \Doctrine\DBAL\Types\Type|string
+ *
+ * @return \Doctrine\DBAL\Types\Type|string|null
*/
public function getTypeOfField($fieldName)
{
@@ -1784,6 +1865,7 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the type of a column.
*
* @param string $columnName
+ *
* @return \Doctrine\DBAL\Types\Type
*/
public function getTypeOfColumn($columnName)
@@ -1816,6 +1898,8 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the mapped subclasses of this class.
*
* @param array $subclasses The names of all mapped subclasses.
+ *
+ * @return void
*/
public function setSubclasses(array $subclasses)
{
@@ -1832,6 +1916,10 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the parent class names.
* Assumes that the class names in the passed array are in the order:
* directParent -> directParentParent -> directParentParentParent ... -> root.
+ *
+ * @param array $classNames
+ *
+ * @return void
*/
public function setParentClasses(array $classNames)
{
@@ -1842,11 +1930,13 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Sets the inheritance type used by the class and it's subclasses.
+ * Sets the inheritance type used by the class and its subclasses.
*
* @param integer $type
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function setInheritanceType($type)
{
@@ -1860,9 +1950,11 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the association to override association mapping of property for an entity relationship.
*
* @param string $fieldName
- * @param array $overrideMapping
- * @throws MappingException
+ * @param array $overrideMapping
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function setAssociationOverride($fieldName, array $overrideMapping)
{
@@ -1908,10 +2000,11 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the override for a mapped field.
*
* @param string $fieldName
- * @param array $overrideMapping
- * @throws MappingException
- * @param array $overrideMapping
+ * @param array $overrideMapping
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function setAttributeOverride($fieldName, array $overrideMapping)
{
@@ -1949,6 +2042,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether a mapped field is inherited from an entity superclass.
*
* @param string $fieldName
+ *
* @return bool TRUE if the field is inherited, FALSE otherwise.
*/
public function isInheritedField($fieldName)
@@ -1957,7 +2051,7 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Check if this entity is the root in any entity-inheritance-hierachy.
+ * Checks if this entity is the root in any entity-inheritance-hierachy.
*
* @return bool
*/
@@ -1970,6 +2064,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether a mapped association field is inherited from a superclass.
*
* @param string $fieldName
+ *
* @return boolean TRUE if the field is inherited, FALSE otherwise.
*/
public function isInheritedAssociation($fieldName)
@@ -1981,6 +2076,9 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the name of the primary table the class is mapped to.
*
* @param string $tableName The table name.
+ *
+ * @return void
+ *
* @deprecated Use {@link setPrimaryTable}.
*/
public function setTableName($tableName)
@@ -1999,6 +2097,8 @@ class ClassMetadataInfo implements ClassMetadata
* If a key is omitted, the current value is kept.
*
* @param array $table The table description.
+ *
+ * @return void
*/
public function setPrimaryTable(array $table)
{
@@ -2028,6 +2128,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether the given type identifies an inheritance type.
*
* @param integer $type
+ *
* @return boolean TRUE if the given type identifies an inheritance type, FALSe otherwise.
*/
private function _isInheritanceType($type)
@@ -2042,8 +2143,10 @@ class ClassMetadataInfo implements ClassMetadata
* Adds a mapped field to the class.
*
* @param array $mapping The field mapping.
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function mapField(array $mapping)
{
@@ -2060,8 +2163,10 @@ class ClassMetadataInfo implements ClassMetadata
* This is mainly used to add inherited association mappings to derived classes.
*
* @param array $mapping
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function addInheritedAssociationMapping(array $mapping/*, $owningClassName = null*/)
{
@@ -2077,6 +2182,7 @@ class ClassMetadataInfo implements ClassMetadata
* This is mainly used to add inherited field mappings to derived classes.
*
* @param array $fieldMapping
+ *
* @return void
*/
public function addInheritedFieldMapping(array $fieldMapping)
@@ -2090,8 +2196,11 @@ class ClassMetadataInfo implements ClassMetadata
* INTERNAL:
* Adds a named query to this class.
*
- * @throws MappingException
* @param array $queryMapping
+ *
+ * @return void
+ *
+ * @throws MappingException
*/
public function addNamedQuery(array $queryMapping)
{
@@ -2121,8 +2230,11 @@ class ClassMetadataInfo implements ClassMetadata
* INTERNAL:
* Adds a named native query to this class.
*
- * @throws MappingException
* @param array $queryMapping
+ *
+ * @return void
+ *
+ * @throws MappingException
*/
public function addNamedNativeQuery(array $queryMapping)
{
@@ -2164,8 +2276,11 @@ class ClassMetadataInfo implements ClassMetadata
* INTERNAL:
* Adds a sql result set mapping to this class.
*
- * @throws MappingException
* @param array $resultMapping
+ *
+ * @return void
+ *
+ * @throws MappingException
*/
public function addSqlResultSetMapping(array $resultMapping)
{
@@ -2222,6 +2337,8 @@ class ClassMetadataInfo implements ClassMetadata
* Adds a one-to-one mapping.
*
* @param array $mapping The mapping.
+ *
+ * @return void
*/
public function mapOneToOne(array $mapping)
{
@@ -2234,6 +2351,8 @@ class ClassMetadataInfo implements ClassMetadata
* Adds a one-to-many mapping.
*
* @param array $mapping The mapping.
+ *
+ * @return void
*/
public function mapOneToMany(array $mapping)
{
@@ -2246,6 +2365,8 @@ class ClassMetadataInfo implements ClassMetadata
* Adds a many-to-one mapping.
*
* @param array $mapping The mapping.
+ *
+ * @return void
*/
public function mapManyToOne(array $mapping)
{
@@ -2259,6 +2380,8 @@ class ClassMetadataInfo implements ClassMetadata
* Adds a many-to-many mapping.
*
* @param array $mapping The mapping.
+ *
+ * @return void
*/
public function mapManyToMany(array $mapping)
{
@@ -2271,8 +2394,10 @@ class ClassMetadataInfo implements ClassMetadata
* Stores the association mapping.
*
* @param array $assocMapping
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
protected function _storeAssociationMapping(array $assocMapping)
{
@@ -2289,6 +2414,7 @@ class ClassMetadataInfo implements ClassMetadata
* Registers a custom repository class for the entity class.
*
* @param string $repositoryClassName The class name of the custom mapper.
+ *
* @return void
*/
public function setCustomRepositoryClass($repositoryClassName)
@@ -2305,7 +2431,9 @@ class ClassMetadataInfo implements ClassMetadata
* lifecycle callbacks and lifecycle listeners.
*
* @param string $lifecycleEvent The lifecycle event.
- * @param \Object $entity The Entity on which the event occured.
+ * @param object $entity The Entity on which the event occured.
+ *
+ * @return void
*/
public function invokeLifecycleCallbacks($lifecycleEvent, $entity)
{
@@ -2318,6 +2446,7 @@ class ClassMetadataInfo implements ClassMetadata
* Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event.
*
* @param string $lifecycleEvent
+ *
* @return boolean
*/
public function hasLifecycleCallbacks($lifecycleEvent)
@@ -2329,6 +2458,7 @@ class ClassMetadataInfo implements ClassMetadata
* Gets the registered lifecycle callbacks for an event.
*
* @param string $event
+ *
* @return array
*/
public function getLifecycleCallbacks($event)
@@ -2341,6 +2471,8 @@ class ClassMetadataInfo implements ClassMetadata
*
* @param string $callback
* @param string $event
+ *
+ * @return void
*/
public function addLifecycleCallback($callback, $event)
{
@@ -2352,6 +2484,8 @@ class ClassMetadataInfo implements ClassMetadata
* Any previously registered callbacks are overwritten.
*
* @param array $callbacks
+ *
+ * @return void
*/
public function setLifecycleCallbacks(array $callbacks)
{
@@ -2363,9 +2497,10 @@ class ClassMetadataInfo implements ClassMetadata
*
* @param array $columnDef
*
- * @param $columnDef
- * @throws MappingException
* @return void
+ *
+ * @throws MappingException
+ *
* @see getDiscriminatorColumn()
*/
public function setDiscriminatorColumn($columnDef)
@@ -2400,6 +2535,8 @@ class ClassMetadataInfo implements ClassMetadata
* Used for JOINED and SINGLE_TABLE inheritance mapping strategies.
*
* @param array $map
+ *
+ * @return void
*/
public function setDiscriminatorMap(array $map)
{
@@ -2409,12 +2546,14 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Add one entry of the discriminator map with a new class and corresponding name.
+ * Adds one entry of the discriminator map with a new class and corresponding name.
*
* @param string $name
* @param string $className
- * @throws MappingException
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function addDiscriminatorMapClass($name, $className)
{
@@ -2441,6 +2580,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether the class has a named query with the given query name.
*
* @param string $queryName
+ *
* @return boolean
*/
public function hasNamedQuery($queryName)
@@ -2452,6 +2592,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether the class has a named native query with the given query name.
*
* @param string $queryName
+ *
* @return boolean
*/
public function hasNamedNativeQuery($queryName)
@@ -2463,6 +2604,7 @@ class ClassMetadataInfo implements ClassMetadata
* Checks whether the class has a named native query with the given query name.
*
* @param string $name
+ *
* @return boolean
*/
public function hasSqlResultSetMapping($name)
@@ -2499,7 +2641,8 @@ class ClassMetadataInfo implements ClassMetadata
/**
* Is this an association that only has a single join column?
*
- * @param string $fieldName
+ * @param string $fieldName
+ *
* @return bool
*/
public function isAssociationWithSingleJoinColumn($fieldName)
@@ -2512,11 +2655,13 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Return the single association join column (if any).
+ * Returns the single association join column (if any).
*
* @param string $fieldName
- * @throws MappingException
+ *
* @return string
+ *
+ * @throws MappingException
*/
public function getSingleAssociationJoinColumnName($fieldName)
{
@@ -2527,11 +2672,13 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Return the single association referenced join column name (if any).
+ * Returns the single association referenced join column name (if any).
*
* @param string $fieldName
- * @throws MappingException
+ *
* @return string
+ *
+ * @throws MappingException
*/
public function getSingleAssociationReferencedJoinColumnName($fieldName)
{
@@ -2542,13 +2689,15 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Used to retrieve a fieldname for either field or association from a given column,
+ * Used to retrieve a fieldname for either field or association from a given column.
*
* This method is used in foreign-key as primary-key contexts.
*
- * @param string $columnName
- * @throws MappingException
+ * @param string $columnName
+ *
* @return string
+ *
+ * @throws MappingException
*/
public function getFieldForColumn($columnName)
{
@@ -2571,6 +2720,8 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the ID generator used to generate IDs for instances of this class.
*
* @param \Doctrine\ORM\Id\AbstractIdGenerator $generator
+ *
+ * @return void
*/
public function setIdGenerator($generator)
{
@@ -2578,8 +2729,11 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Sets definition
+ * Sets definition.
+ *
* @param array $definition
+ *
+ * @return void
*/
public function setCustomGeneratorDefinition(array $definition)
{
@@ -2600,6 +2754,8 @@ class ClassMetadataInfo implements ClassMetadata
*
*
* @param array $definition
+ *
+ * @return void
*/
public function setSequenceGeneratorDefinition(array $definition)
{
@@ -2615,9 +2771,11 @@ class ClassMetadataInfo implements ClassMetadata
* Sets the version field mapping used for versioning. Sets the default
* value to use depending on the column type.
*
- * @param array $mapping The version field mapping array
- * @throws MappingException
+ * @param array $mapping The version field mapping array.
+ *
* @return void
+ *
+ * @throws MappingException
*/
public function setVersionMapping(array &$mapping)
{
@@ -2639,6 +2797,8 @@ class ClassMetadataInfo implements ClassMetadata
* Sets whether this class is to be versioned for optimistic locking.
*
* @param boolean $bool
+ *
+ * @return void
*/
public function setVersioned($bool)
{
@@ -2650,6 +2810,8 @@ class ClassMetadataInfo implements ClassMetadata
* versioned for optimistic locking.
*
* @param string $versionField
+ *
+ * @return void
*/
public function setVersionField($versionField)
{
@@ -2657,7 +2819,7 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * Mark this class as read only, no change tracking is applied to it.
+ * Marks this class as read only, no change tracking is applied to it.
*
* @return void
*/
@@ -2684,6 +2846,7 @@ class ClassMetadataInfo implements ClassMetadata
/**
* {@inheritDoc}
+ *
* @throws InvalidArgumentException
*/
public function getAssociationTargetClass($assocName)
@@ -2709,6 +2872,7 @@ class ClassMetadataInfo implements ClassMetadata
* @deprecated Deprecated since version 2.3 in favor of \Doctrine\ORM\Mapping\QuoteStrategy
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
* @return array
*/
public function getQuotedIdentifierColumnNames($platform)
@@ -2746,8 +2910,9 @@ class ClassMetadataInfo implements ClassMetadata
*
* @deprecated Deprecated since version 2.3 in favor of \Doctrine\ORM\Mapping\QuoteStrategy
*
- * @param string $field
+ * @param string $field
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
* @return string
*/
public function getQuotedColumnName($field, $platform)
@@ -2763,6 +2928,7 @@ class ClassMetadataInfo implements ClassMetadata
* @deprecated Deprecated since version 2.3 in favor of \Doctrine\ORM\Mapping\QuoteStrategy
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
* @return string
*/
public function getQuotedTableName($platform)
@@ -2775,8 +2941,9 @@ class ClassMetadataInfo implements ClassMetadata
*
* @deprecated Deprecated since version 2.3 in favor of \Doctrine\ORM\Mapping\QuoteStrategy
*
- * @param array $assoc
+ * @param array $assoc
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
* @return string
*/
public function getQuotedJoinTableName(array $assoc, $platform)
@@ -2801,8 +2968,9 @@ class ClassMetadataInfo implements ClassMetadata
}
/**
- * @param string $targetClass
- * @return array
+ * @param string $targetClass
+ *
+ * @return array
*/
public function getAssociationsByTargetClass($targetClass)
{
diff --git a/lib/Doctrine/ORM/Mapping/Column.php b/lib/Doctrine/ORM/Mapping/Column.php
index b233566fb..70337323f 100644
--- a/lib/Doctrine/ORM/Mapping/Column.php
+++ b/lib/Doctrine/ORM/Mapping/Column.php
@@ -25,22 +25,52 @@ namespace Doctrine\ORM\Mapping;
*/
final class Column implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var mixed */
+
+ /**
+ * @var mixed
+ */
public $type = 'string';
- /** @var integer */
+
+ /**
+ * @var integer
+ */
public $length;
- /** @var integer */
- public $precision = 0; // The precision for a decimal (exact numeric) column (Applies only for decimal column)
- /** @var integer */
- public $scale = 0; // The scale for a decimal (exact numeric) column (Applies only for decimal column)
- /** @var boolean */
+
+ /**
+ * The precision for a decimal (exact numeric) column (Applies only for decimal column).
+ *
+ * @var integer
+ */
+ public $precision = 0;
+
+ /**
+ * The scale for a decimal (exact numeric) column (Applies only for decimal column).
+ *
+ * @var integer
+ */
+ public $scale = 0;
+
+ /**
+ * @var boolean
+ */
public $unique = false;
- /** @var boolean */
+
+ /**
+ * @var boolean
+ */
public $nullable = false;
- /** @var array */
+
+ /**
+ * @var array
+ */
public $options = array();
- /** @var string */
+
+ /**
+ * @var string
+ */
public $columnDefinition;
}
diff --git a/lib/Doctrine/ORM/Mapping/ColumnResult.php b/lib/Doctrine/ORM/Mapping/ColumnResult.php
index cf5c2b430..a164c85c0 100644
--- a/lib/Doctrine/ORM/Mapping/ColumnResult.php
+++ b/lib/Doctrine/ORM/Mapping/ColumnResult.php
@@ -31,12 +31,10 @@ namespace Doctrine\ORM\Mapping;
*/
final class ColumnResult implements Annotation
{
-
/**
- * The name of a column in the SELECT clause of a SQL query
+ * The name of a column in the SELECT clause of a SQL query.
*
* @var string
*/
public $name;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php b/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php
index f31f08224..41e200e12 100644
--- a/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php
+++ b/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class CustomIdGenerator implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $class;
}
diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
index b5a6fc4f1..3f5b0c853 100644
--- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
+++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php
@@ -136,5 +136,4 @@ class DefaultQuoteStrategy implements QuoteStrategy
return $platform->getSQLResultCasing($columnName);
}
-
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php b/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php
index f5cb0778a..97ca7e9b5 100644
--- a/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php
+++ b/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php
@@ -25,14 +25,30 @@ namespace Doctrine\ORM\Mapping;
*/
final class DiscriminatorColumn implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $type;
- /** @var integer */
+
+ /**
+ * @var integer
+ */
public $length;
- /** @var mixed */
- public $fieldName; // field name used in non-object hydration (array/scalar)
- /** @var string */
+
+ /**
+ * Field name used in non-object hydration (array/scalar).
+ *
+ * @var mixed
+ */
+ public $fieldName;
+
+ /**
+ * @var string
+ */
public $columnDefinition;
}
diff --git a/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php b/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php
index d68b85b6d..09d619465 100644
--- a/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php
+++ b/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class DiscriminatorMap implements Annotation
{
- /** @var array */
+ /**
+ * @var array
+ */
public $value;
}
diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
index bb0189620..004b55c5b 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
@@ -19,12 +19,12 @@
namespace Doctrine\ORM\Mapping\Driver;
-use Doctrine\Common\Annotations\AnnotationReader,
- Doctrine\ORM\Mapping\MappingException,
- Doctrine\ORM\Mapping\JoinColumn,
- Doctrine\ORM\Mapping\Column,
- Doctrine\Common\Persistence\Mapping\ClassMetadata,
- Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\ORM\Mapping\MappingException;
+use Doctrine\ORM\Mapping\JoinColumn;
+use Doctrine\ORM\Mapping\Column;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver;
/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
@@ -471,10 +471,12 @@ class AnnotationDriver extends AbstractAnnotationDriver
/**
* Attempts to resolve the fetch mode.
*
- * @param string $className The class name
- * @param string $fetchMode The fetch mode
- * @return integer The fetch mode as defined in ClassMetadata
- * @throws MappingException If the fetch mode is not valid
+ * @param string $className The class name.
+ * @param string $fetchMode The fetch mode.
+ *
+ * @return integer The fetch mode as defined in ClassMetadata.
+ *
+ * @throws MappingException If the fetch mode is not valid.
*/
private function getFetchMode($className, $fetchMode)
{
@@ -486,10 +488,11 @@ class AnnotationDriver extends AbstractAnnotationDriver
}
/**
- * Parse the given JoinColumn as array
+ * Parses the given JoinColumn as array.
*
- * @param JoinColumn $joinColumn
- * @return array
+ * @param JoinColumn $joinColumn
+ *
+ * @return array
*/
private function joinColumnToArray(JoinColumn $joinColumn)
{
@@ -506,9 +509,10 @@ class AnnotationDriver extends AbstractAnnotationDriver
/**
* Parse the given Column as array
*
- * @param string $fieldName
- * @param Column $column
- * @return array
+ * @param string $fieldName
+ * @param Column $column
+ *
+ * @return array
*/
private function columnToArray($fieldName, Column $column)
{
@@ -538,10 +542,11 @@ class AnnotationDriver extends AbstractAnnotationDriver
}
/**
- * Factory method for the Annotation Driver
+ * Factory method for the Annotation Driver.
+ *
+ * @param array|string $paths
+ * @param AnnotationReader|null $reader
*
- * @param array|string $paths
- * @param AnnotationReader $reader
* @return AnnotationDriver
*/
static public function create($paths = array(), AnnotationReader $reader = null)
diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
index b2ae31251..e1f75da6d 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
@@ -19,18 +19,17 @@
namespace Doctrine\ORM\Mapping\Driver;
-use Doctrine\DBAL\Schema\AbstractSchemaManager,
- Doctrine\DBAL\Schema\SchemaException,
- Doctrine\Common\Persistence\Mapping\Driver\MappingDriver,
- Doctrine\Common\Persistence\Mapping\ClassMetadata,
- Doctrine\ORM\Mapping\ClassMetadataInfo,
- Doctrine\Common\Util\Inflector,
- Doctrine\ORM\Mapping\MappingException;
+use Doctrine\DBAL\Schema\AbstractSchemaManager;
+use Doctrine\DBAL\Schema\SchemaException;
+use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\ORM\Mapping\ClassMetadataInfo;
+use Doctrine\Common\Util\Inflector;
+use Doctrine\ORM\Mapping\MappingException;
/**
* The DatabaseDriver reverse engineers the mapping metadata from a database.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -45,10 +44,13 @@ class DatabaseDriver implements MappingDriver
private $_sm;
/**
- * @var array
+ * @var array|null
*/
private $tables = null;
+ /**
+ * @var array
+ */
private $classToTableNames = array();
/**
@@ -69,12 +71,11 @@ class DatabaseDriver implements MappingDriver
/**
* The namespace for the generated entities.
*
- * @var string
+ * @var string|null
*/
private $namespace;
/**
- *
* @param AbstractSchemaManager $schemaManager
*/
public function __construct(AbstractSchemaManager $schemaManager)
@@ -83,10 +84,11 @@ class DatabaseDriver implements MappingDriver
}
/**
- * Set tables manually instead of relying on the reverse engeneering capabilities of SchemaManager.
+ * Sets tables manually instead of relying on the reverse engeneering capabilities of SchemaManager.
*
* @param array $entityTables
* @param array $manyToManyTables
+ *
* @return void
*/
public function setTables($entityTables, $manyToManyTables)
@@ -102,6 +104,11 @@ class DatabaseDriver implements MappingDriver
}
}
+ /**
+ * @return void
+ *
+ * @throws \Doctrine\ORM\Mapping\MappingException
+ */
private function reverseEngineerMappingFromDatabase()
{
if ($this->tables !== null) {
@@ -340,10 +347,11 @@ class DatabaseDriver implements MappingDriver
}
/**
- * Set class name for a table.
+ * Sets class name for a table.
*
* @param string $tableName
* @param string $className
+ *
* @return void
*/
public function setClassNameForTable($tableName, $className)
@@ -352,11 +360,12 @@ class DatabaseDriver implements MappingDriver
}
/**
- * Set field name for a column on a specific table.
+ * Sets field name for a column on a specific table.
*
* @param string $tableName
* @param string $columnName
* @param string $fieldName
+ *
* @return void
*/
public function setFieldNameForColumn($tableName, $columnName, $fieldName)
@@ -365,9 +374,10 @@ class DatabaseDriver implements MappingDriver
}
/**
- * Return the mapped class name for a table if it exists. Otherwise return "classified" version.
+ * Returns the mapped class name for a table if it exists. Otherwise return "classified" version.
*
* @param string $tableName
+ *
* @return string
*/
private function getClassNameForTable($tableName)
@@ -382,9 +392,10 @@ class DatabaseDriver implements MappingDriver
/**
* Return the mapped field name for a column, if it exists. Otherwise return camelized version.
*
- * @param string $tableName
- * @param string $columnName
+ * @param string $tableName
+ * @param string $columnName
* @param boolean $fk Whether the column is a foreignkey or not.
+ *
* @return string
*/
private function getFieldNameForColumn($tableName, $columnName, $fk = false)
@@ -406,6 +417,7 @@ class DatabaseDriver implements MappingDriver
* Set the namespace for the generated entities.
*
* @param string $namespace
+ *
* @return void
*/
public function setNamespace($namespace)
diff --git a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php
index 02d409d43..f4cd8cd60 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php
@@ -28,4 +28,4 @@ use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
*/
class DriverChain extends MappingDriverChain
{
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php
index 3d60447f4..28e2dbea2 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php
@@ -28,4 +28,4 @@ use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver as CommonPHPDriver;
*/
class PHPDriver extends CommonPHPDriver
{
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php
index 6d53f778a..d6c6ead85 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php
@@ -28,4 +28,4 @@ use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver as CommonStaticPH
*/
class StaticPHPDriver extends CommonStaticPHPDriver
{
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
index bc0e79e70..b8b5e13b2 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
@@ -561,7 +561,8 @@ class XmlDriver extends FileDriver
/**
* Parses (nested) option elements.
*
- * @param SimpleXMLElement $options the XML element.
+ * @param SimpleXMLElement $options The XML element.
+ *
* @return array The options array.
*/
private function _parseOptions(SimpleXMLElement $options)
@@ -592,7 +593,8 @@ class XmlDriver extends FileDriver
* Constructs a joinColumn mapping array based on the information
* found in the given SimpleXMLElement.
*
- * @param SimpleXMLElement $joinColumnElement the XML element.
+ * @param SimpleXMLElement $joinColumnElement The XML element.
+ *
* @return array The mapping array.
*/
private function joinColumnToArray(SimpleXMLElement $joinColumnElement)
@@ -622,10 +624,11 @@ class XmlDriver extends FileDriver
}
/**
- * Parse the given field as array
+ * Parses the given field as array.
*
- * @param SimpleXMLElement $fieldMapping
- * @return array
+ * @param SimpleXMLElement $fieldMapping
+ *
+ * @return array
*/
private function columnToArray(SimpleXMLElement $fieldMapping)
{
@@ -679,7 +682,8 @@ class XmlDriver extends FileDriver
/**
* Gathers a list of cascade options found in the given cascade element.
*
- * @param SimpleXMLElement $cascadeElement the cascade element.
+ * @param SimpleXMLElement $cascadeElement The cascade element.
+ *
* @return array The list of cascade options.
*/
private function _getCascadeMappings($cascadeElement)
@@ -720,6 +724,11 @@ class XmlDriver extends FileDriver
return $result;
}
+ /**
+ * @param mixed $element
+ *
+ * @return bool
+ */
protected function evaluateBoolean($element)
{
$flag = (string)$element;
@@ -727,4 +736,3 @@ class XmlDriver extends FileDriver
return ($flag === true || $flag == "true" || $flag == "1");
}
}
-
diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
index 35631e7a1..50e51ed05 100644
--- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
+++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
@@ -19,10 +19,10 @@
namespace Doctrine\ORM\Mapping\Driver;
-use Doctrine\Common\Persistence\Mapping\ClassMetadata,
- Doctrine\Common\Persistence\Mapping\Driver\FileDriver,
- Doctrine\ORM\Mapping\MappingException,
- Symfony\Component\Yaml\Yaml;
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
+use Doctrine\Common\Persistence\Mapping\Driver\FileDriver;
+use Doctrine\ORM\Mapping\MappingException;
+use Symfony\Component\Yaml\Yaml;
/**
* The YamlDriver reads the mapping metadata from yaml schema files.
@@ -578,7 +578,8 @@ class YamlDriver extends FileDriver
* Constructs a joinColumn mapping array based on the information
* found in the given join column element.
*
- * @param array $joinColumnElement The array join column element
+ * @param array $joinColumnElement The array join column element.
+ *
* @return array The mapping array.
*/
private function joinColumnToArray($joinColumnElement)
@@ -616,10 +617,11 @@ class YamlDriver extends FileDriver
}
/**
- * Parse the given column as array
+ * Parses the given column as array.
+ *
+ * @param string $fieldName
+ * @param array $column
*
- * @param string $fieldName
- * @param array $column
* @return array
*/
private function columnToArray($fieldName, $column)
diff --git a/lib/Doctrine/ORM/Mapping/ElementCollection.php b/lib/Doctrine/ORM/Mapping/ElementCollection.php
index f3f4f4cf7..46720d688 100644
--- a/lib/Doctrine/ORM/Mapping/ElementCollection.php
+++ b/lib/Doctrine/ORM/Mapping/ElementCollection.php
@@ -26,6 +26,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class ElementCollection implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $tableName;
}
diff --git a/lib/Doctrine/ORM/Mapping/Entity.php b/lib/Doctrine/ORM/Mapping/Entity.php
index d1b4eb2ac..edf6ad5a4 100644
--- a/lib/Doctrine/ORM/Mapping/Entity.php
+++ b/lib/Doctrine/ORM/Mapping/Entity.php
@@ -25,8 +25,13 @@ namespace Doctrine\ORM\Mapping;
*/
final class Entity implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $repositoryClass;
- /** @var boolean */
+
+ /**
+ * @var boolean
+ */
public $readOnly = false;
}
diff --git a/lib/Doctrine/ORM/Mapping/EntityResult.php b/lib/Doctrine/ORM/Mapping/EntityResult.php
index af26a11c0..63bbed22f 100644
--- a/lib/Doctrine/ORM/Mapping/EntityResult.php
+++ b/lib/Doctrine/ORM/Mapping/EntityResult.php
@@ -33,9 +33,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class EntityResult implements Annotation
{
-
/**
- * The class of the result
+ * The class of the result.
*
* @var string
*/
@@ -54,5 +53,4 @@ final class EntityResult implements Annotation
* @var string
*/
public $discriminatorColumn;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/FieldResult.php b/lib/Doctrine/ORM/Mapping/FieldResult.php
index ee330b2ff..5e8aa0cd3 100644
--- a/lib/Doctrine/ORM/Mapping/FieldResult.php
+++ b/lib/Doctrine/ORM/Mapping/FieldResult.php
@@ -30,7 +30,6 @@ namespace Doctrine\ORM\Mapping;
*/
final class FieldResult implements Annotation
{
-
/**
* Name of the column in the SELECT clause.
*
@@ -39,10 +38,9 @@ final class FieldResult implements Annotation
public $name;
/**
- * Name of the persistent field or property of the class.
+ * Name of the persistent field or property of the class.
*
* @var string
*/
public $column;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/GeneratedValue.php b/lib/Doctrine/ORM/Mapping/GeneratedValue.php
index 1dee4e0c8..27c03d4be 100644
--- a/lib/Doctrine/ORM/Mapping/GeneratedValue.php
+++ b/lib/Doctrine/ORM/Mapping/GeneratedValue.php
@@ -26,7 +26,9 @@ namespace Doctrine\ORM\Mapping;
final class GeneratedValue implements Annotation
{
/**
- * @var string The type of Id generator.
+ * The type of Id generator.
+ *
+ * @var string
*
* @Enum({"AUTO", "SEQUENCE", "TABLE", "IDENTITY", "NONE", "UUID", "CUSTOM"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/Index.php b/lib/Doctrine/ORM/Mapping/Index.php
index 51f037ab9..a6696c4b6 100644
--- a/lib/Doctrine/ORM/Mapping/Index.php
+++ b/lib/Doctrine/ORM/Mapping/Index.php
@@ -25,8 +25,13 @@ namespace Doctrine\ORM\Mapping;
*/
final class Index implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var array */
+
+ /**
+ * @var array
+ */
public $columns;
}
diff --git a/lib/Doctrine/ORM/Mapping/InheritanceType.php b/lib/Doctrine/ORM/Mapping/InheritanceType.php
index 28d383ab4..de803369a 100644
--- a/lib/Doctrine/ORM/Mapping/InheritanceType.php
+++ b/lib/Doctrine/ORM/Mapping/InheritanceType.php
@@ -26,7 +26,9 @@ namespace Doctrine\ORM\Mapping;
final class InheritanceType implements Annotation
{
/**
- * @var string The inheritance type used by the class and it's subclasses.
+ * The inheritance type used by the class and its subclasses.
+ *
+ * @var string
*
* @Enum({"NONE", "JOINED", "SINGLE_TABLE", "TABLE_PER_CLASS"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/JoinColumn.php b/lib/Doctrine/ORM/Mapping/JoinColumn.php
index 8c9bc1045..febce9174 100644
--- a/lib/Doctrine/ORM/Mapping/JoinColumn.php
+++ b/lib/Doctrine/ORM/Mapping/JoinColumn.php
@@ -25,18 +25,40 @@ namespace Doctrine\ORM\Mapping;
*/
final class JoinColumn implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $referencedColumnName = 'id';
- /** @var boolean */
+
+ /**
+ * @var boolean
+ */
public $unique = false;
- /** @var boolean */
+
+ /**
+ * @var boolean
+ */
public $nullable = true;
- /** @var mixed */
+
+ /**
+ * @var mixed
+ */
public $onDelete;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $columnDefinition;
- /** @var string */
- public $fieldName; // field name used in non-object hydration (array/scalar)
+
+ /**
+ * Field name used in non-object hydration (array/scalar).
+ *
+ * @var string
+ */
+ public $fieldName;
}
diff --git a/lib/Doctrine/ORM/Mapping/JoinColumns.php b/lib/Doctrine/ORM/Mapping/JoinColumns.php
index 8d4c04507..ae096c275 100644
--- a/lib/Doctrine/ORM/Mapping/JoinColumns.php
+++ b/lib/Doctrine/ORM/Mapping/JoinColumns.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class JoinColumns implements Annotation
{
- /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */
+ /**
+ * @var array<\Doctrine\ORM\Mapping\JoinColumn>
+ */
public $value;
}
diff --git a/lib/Doctrine/ORM/Mapping/JoinTable.php b/lib/Doctrine/ORM/Mapping/JoinTable.php
index 7fb69cbf3..8a440c614 100644
--- a/lib/Doctrine/ORM/Mapping/JoinTable.php
+++ b/lib/Doctrine/ORM/Mapping/JoinTable.php
@@ -25,12 +25,23 @@ namespace Doctrine\ORM\Mapping;
*/
final class JoinTable implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $schema;
- /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */
+
+ /**
+ * @var array<\Doctrine\ORM\Mapping\JoinColumn>
+ */
public $joinColumns = array();
- /** @var array<\Doctrine\ORM\Mapping\JoinColumn> */
+
+ /**
+ * @var array<\Doctrine\ORM\Mapping\JoinColumn>
+ */
public $inverseJoinColumns = array();
}
diff --git a/lib/Doctrine/ORM/Mapping/ManyToMany.php b/lib/Doctrine/ORM/Mapping/ManyToMany.php
index a02848756..ca2f53c9e 100644
--- a/lib/Doctrine/ORM/Mapping/ManyToMany.php
+++ b/lib/Doctrine/ORM/Mapping/ManyToMany.php
@@ -46,7 +46,9 @@ final class ManyToMany implements Annotation
public $cascade;
/**
- * @var string The fetching strategy to use for the association.
+ * The fetching strategy to use for the association.
+ *
+ * @var string
*
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/ManyToOne.php b/lib/Doctrine/ORM/Mapping/ManyToOne.php
index 12148417e..d3414e6a9 100644
--- a/lib/Doctrine/ORM/Mapping/ManyToOne.php
+++ b/lib/Doctrine/ORM/Mapping/ManyToOne.php
@@ -36,7 +36,9 @@ final class ManyToOne implements Annotation
public $cascade;
/**
- * @var string The fetching strategy to use for the association.
+ * The fetching strategy to use for the association.
+ *
+ * @var string
*
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/MappedSuperclass.php b/lib/Doctrine/ORM/Mapping/MappedSuperclass.php
index b55161086..74588107d 100644
--- a/lib/Doctrine/ORM/Mapping/MappedSuperclass.php
+++ b/lib/Doctrine/ORM/Mapping/MappedSuperclass.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class MappedSuperclass implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $repositoryClass;
}
diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php
index 9b97a1f0b..3c32eebd5 100644
--- a/lib/Doctrine/ORM/Mapping/MappingException.php
+++ b/lib/Doctrine/ORM/Mapping/MappingException.php
@@ -26,12 +26,20 @@ namespace Doctrine\ORM\Mapping;
*/
class MappingException extends \Doctrine\ORM\ORMException
{
+ /**
+ * @return MappingException
+ */
public static function pathRequired()
{
return new self("Specifying the paths to your entities is required ".
"in the AnnotationDriver to retrieve all class names.");
}
+ /**
+ * @param string $entityName
+ *
+ * @return MappingException
+ */
public static function identifierRequired($entityName)
{
if (false !== ($parent = get_parent_class($entityName))) {
@@ -48,41 +56,73 @@ class MappingException extends \Doctrine\ORM\ORMException
}
+ /**
+ * @param string $entityName
+ * @param string $type
+ *
+ * @return MappingException
+ */
public static function invalidInheritanceType($entityName, $type)
{
return new self("The inheritance type '$type' specified for '$entityName' does not exist.");
}
+ /**
+ * @return MappingException
+ */
public static function generatorNotAllowedWithCompositeId()
{
return new self("Id generators can't be used with a composite id.");
}
+ /**
+ * @param string $entity
+ *
+ * @return MappingException
+ */
public static function missingFieldName($entity)
{
return new self("The field or association mapping misses the 'fieldName' attribute in entity '$entity'.");
}
+ /**
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function missingTargetEntity($fieldName)
{
return new self("The association mapping '$fieldName' misses the 'targetEntity' attribute.");
}
+ /**
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function missingSourceEntity($fieldName)
{
return new self("The association mapping '$fieldName' misses the 'sourceEntity' attribute.");
}
+ /**
+ * @param string $entityName
+ * @param string $fileName
+ *
+ * @return MappingException
+ */
public static function mappingFileNotFound($entityName, $fileName)
{
return new self("No mapping file found named '$fileName' for class '$entityName'.");
}
- /**
+ /**
* Exception for invalid property name override.
*
- * @param string $className The entity's name
+ * @param string $className The entity's name.
* @param string $fieldName
+ *
+ * @return MappingException
*/
public static function invalidOverrideFieldName($className, $fieldName)
{
@@ -92,64 +132,128 @@ class MappingException extends \Doctrine\ORM\ORMException
/**
* Exception for invalid property type override.
*
- * @param string $className The entity's name
+ * @param string $className The entity's name.
* @param string $fieldName
+ *
+ * @return MappingException
*/
public static function invalidOverrideFieldType($className, $fieldName)
{
return new self("The column type of attribute '$fieldName' on class '$className' could not be changed.");
}
+ /**
+ * @param string $className
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function mappingNotFound($className, $fieldName)
{
return new self("No mapping found for field '$fieldName' on class '$className'.");
}
+ /**
+ * @param string $className
+ * @param string $queryName
+ *
+ * @return MappingException
+ */
public static function queryNotFound($className, $queryName)
{
return new self("No query found named '$queryName' on class '$className'.");
}
+ /**
+ * @param string $className
+ * @param string $resultName
+ *
+ * @return MappingException
+ */
public static function resultMappingNotFound($className, $resultName)
{
return new self("No result set mapping found named '$resultName' on class '$className'.");
}
+ /**
+ * @param string $entity
+ * @param string $queryName
+ *
+ * @return MappingException
+ */
public static function emptyQueryMapping($entity, $queryName)
{
return new self('Query named "'.$queryName.'" in "'.$entity.'" could not be empty.');
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function nameIsMandatoryForQueryMapping($className)
{
return new self("Query name on entity class '$className' is not defined.");
}
+ /**
+ * @param string $entity
+ * @param string $queryName
+ *
+ * @return MappingException
+ */
public static function missingQueryMapping($entity, $queryName)
{
return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.');
}
+ /**
+ * @param string $entity
+ * @param string $resultName
+ *
+ * @return MappingException
+ */
public static function missingResultSetMappingEntity($entity, $resultName)
{
return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.');
}
+ /**
+ * @param string $entity
+ * @param string $resultName
+ *
+ * @return MappingException
+ */
public static function missingResultSetMappingFieldName($entity, $resultName)
{
return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.');
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function nameIsMandatoryForSqlResultSetMapping($className)
{
return new self("Result set mapping name on entity class '$className' is not defined.");
}
+ /**
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function oneToManyRequiresMappedBy($fieldName)
{
return new self("OneToMany mapping on field '$fieldName' requires the 'mappedBy' attribute.");
}
+ /**
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function joinTableRequired($fieldName)
{
return new self("The mapping of field '$fieldName' requires an the 'joinTable' attribute.");
@@ -158,10 +262,11 @@ class MappingException extends \Doctrine\ORM\ORMException
/**
* Called if a required option was not found but is required
*
- * @param string $field which field cannot be processed?
- * @param string $expectedOption which option is required
- * @param string $hint Can optionally be used to supply a tip for common mistakes,
- * e.g. "Did you think of the plural s?"
+ * @param string $field Which field cannot be processed?
+ * @param string $expectedOption Which option is required
+ * @param string $hint Can optionally be used to supply a tip for common mistakes,
+ * e.g. "Did you think of the plural s?"
+ *
* @return MappingException
*/
static function missingRequiredOption($field, $expectedOption, $hint = '')
@@ -179,6 +284,8 @@ class MappingException extends \Doctrine\ORM\ORMException
* Generic exception for invalid mappings.
*
* @param string $fieldName
+ *
+ * @return MappingException
*/
public static function invalidMapping($fieldName)
{
@@ -190,20 +297,33 @@ class MappingException extends \Doctrine\ORM\ORMException
* because there might be long classnames that will be shortened
* within the stacktrace
*
- * @param string $entity The entity's name
+ * @param string $entity The entity's name
* @param \ReflectionException $previousException
+ *
+ * @return MappingException
*/
public static function reflectionFailure($entity, \ReflectionException $previousException)
{
return new self('An error occurred in ' . $entity, 0, $previousException);
}
+ /**
+ * @param string $className
+ * @param string $joinColumn
+ *
+ * @return MappingException
+ */
public static function joinColumnMustPointToMappedField($className, $joinColumn)
{
return new self('The column ' . $joinColumn . ' must be mapped to a field in class '
. $className . ' since it is referenced by a join column of another class.');
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function classIsNotAValidEntityOrMappedSuperClass($className)
{
if (false !== ($parent = get_parent_class($className))) {
@@ -219,45 +339,88 @@ class MappingException extends \Doctrine\ORM\ORMException
));
}
+ /**
+ * @param string $className
+ * @param string $propertyName
+ *
+ * @return MappingException
+ */
public static function propertyTypeIsRequired($className, $propertyName)
{
return new self("The attribute 'type' is required for the column description of property ".$className."::\$".$propertyName.".");
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function tableIdGeneratorNotImplemented($className)
{
return new self("TableIdGenerator is not yet implemented for use with class ".$className);
}
/**
- * @param string $entity The entity's name
- * @param string $fieldName The name of the field that was already declared
+ * @param string $entity The entity's name.
+ * @param string $fieldName The name of the field that was already declared.
+ *
+ * @return MappingException
*/
public static function duplicateFieldMapping($entity, $fieldName)
{
return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once');
}
+ /**
+ * @param string $entity
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function duplicateAssociationMapping($entity, $fieldName)
{
return new self('Property "'.$fieldName.'" in "'.$entity.'" was already declared, but it must be declared only once');
}
+ /**
+ * @param string $entity
+ * @param string $queryName
+ *
+ * @return MappingException
+ */
public static function duplicateQueryMapping($entity, $queryName)
{
return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once');
}
+ /**
+ * @param string $entity
+ * @param string $resultName
+ *
+ * @return MappingException
+ */
public static function duplicateResultSetMapping($entity, $resultName)
{
return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once');
}
+ /**
+ * @param string $entity
+ *
+ * @return MappingException
+ */
public static function singleIdNotAllowedOnCompositePrimaryKey($entity)
{
return new self('Single id is not allowed on composite primary key in entity '.$entity);
}
+ /**
+ * @param string $entity
+ * @param string $fieldName
+ * @param string $unsupportedType
+ *
+ * @return MappingException
+ */
public static function unsupportedOptimisticLockingType($entity, $fieldName, $unsupportedType)
{
return new self('Locking type "'.$unsupportedType.'" (specified in "'.$entity.'", field "'.$fieldName.'") '
@@ -265,6 +428,11 @@ class MappingException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param string|null $path
+ *
+ * @return MappingException
+ */
public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null)
{
if ( ! empty($path)) {
@@ -278,12 +446,13 @@ class MappingException extends \Doctrine\ORM\ORMException
}
/**
- * Throws an exception that indicates that a class used in a discriminator map does not exist.
+ * Returns an exception that indicates that a class used in a discriminator map does not exist.
* An example would be an outdated (maybe renamed) classname.
*
- * @param string $className The class that could not be found
+ * @param string $className The class that could not be found
* @param string $owningClass The class that declares the discriminator map.
- * @return self
+ *
+ * @return MappingException
*/
public static function invalidClassInDiscriminatorMap($className, $owningClass)
{
@@ -293,6 +462,13 @@ class MappingException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param string $className
+ * @param array $entries
+ * @param array $map
+ *
+ * @return MappingException
+ */
public static function duplicateDiscriminatorEntry($className, array $entries, array $map)
{
return new self(
@@ -304,46 +480,87 @@ class MappingException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function missingDiscriminatorMap($className)
{
return new self("Entity class '$className' is using inheritance but no discriminator map was defined.");
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function missingDiscriminatorColumn($className)
{
return new self("Entity class '$className' is using inheritance but no discriminator column was defined.");
}
+ /**
+ * @param string $className
+ * @param string $type
+ *
+ * @return MappingException
+ */
public static function invalidDiscriminatorColumnType($className, $type)
{
return new self("Discriminator column type on entity class '$className' is not allowed to be '$type'. 'string' or 'integer' type variables are suggested!");
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function nameIsMandatoryForDiscriminatorColumns($className)
{
return new self("Discriminator column name on entity class '$className' is not defined.");
}
+ /**
+ * @param string $className
+ * @param string $fieldName
+ *
+ * @return MappingException
+ */
public static function cannotVersionIdField($className, $fieldName)
{
return new self("Setting Id field '$fieldName' as versionale in entity class '$className' is not supported.");
}
+ /**
+ * @param string $className
+ * @param string $fieldName
+ * @param string $type
+ *
+ * @return MappingException
+ */
public static function sqlConversionNotAllowedForIdentifiers($className, $fieldName, $type)
{
return new self("It is not possible to set id field '$fieldName' to type '$type' in entity class '$className'. The type '$type' requires conversion SQL which is not allowed for identifiers.");
}
/**
- * @param string $className
- * @param string $columnName
- * @return self
+ * @param string $className
+ * @param string $columnName
+ *
+ * @return MappingException
*/
public static function duplicateColumnName($className, $columnName)
{
return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function illegalToManyAssocationOnMappedSuperclass($className, $field)
{
return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className."#".$field."'.");
@@ -353,7 +570,8 @@ class MappingException extends \Doctrine\ORM\ORMException
* @param string $className
* @param string $targetEntity
* @param string $targetField
- * @return self
+ *
+ * @return MappingException
*/
public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField)
{
@@ -361,44 +579,91 @@ class MappingException extends \Doctrine\ORM\ORMException
"as part of the primary key of another entity '".$targetEntity."#".$targetField."'.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function noSingleAssociationJoinColumnFound($className, $field)
{
return new self("'$className#$field' is not an association with a single join column.");
}
+ /**
+ * @param string $className
+ * @param string $column
+ *
+ * @return MappingException
+ */
public static function noFieldNameFoundForColumn($className, $column)
{
return new self("Cannot find a field on '$className' that is mapped to column '$column'. Either the ".
"field does not exist or an association exists but it has multiple join columns.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function illegalOrphanRemovalOnIdentifierAssociation($className, $field)
{
return new self("The orphan removal option is not allowed on an association that is ".
"part of the identifier in '$className#$field'.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function illegalOrphanRemoval($className, $field)
{
return new self("Orphan removal is only allowed on one-to-one and one-to-many ".
"associations, but " . $className."#" .$field . " is not.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function illegalInverseIdentifierAssocation($className, $field)
{
return new self("An inverse association is not allowed to be identifier in '$className#$field'.");
}
+ /**
+ * @param string $className
+ * @param string $field
+ *
+ * @return MappingException
+ */
public static function illegalToManyIdentifierAssoaction($className, $field)
{
return new self("Many-to-many or one-to-many associations are not allowed to be identifier in '$className#$field'.");
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function noInheritanceOnMappedSuperClass($className)
{
return new self("Its not supported to define inheritance information on a mapped superclass '" . $className . "'.");
}
+ /**
+ * @param string $className
+ * @param string $rootClassName
+ *
+ * @return MappingException
+ */
public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName)
{
return new self(
@@ -408,26 +673,57 @@ class MappingException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param string $className
+ * @param string $methodName
+ *
+ * @return MappingException
+ */
public static function lifecycleCallbackMethodNotFound($className, $methodName)
{
return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback.");
}
+ /**
+ * @param string $className
+ * @param string $annotation
+ *
+ * @return MappingException
+ */
public static function invalidFetchMode($className, $annotation)
{
return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
}
+ /**
+ * @param string $className
+ *
+ * @return MappingException
+ */
public static function compositeKeyAssignedIdGeneratorRequired($className)
{
return new self("Entity '". $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported.");
}
+ /**
+ * @param string $targetEntity
+ * @param string $sourceEntity
+ * @param string $associationName
+ *
+ * @return MappingException
+ */
public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName)
{
return new self("The target-entity " . $targetEntity . " cannot be found in '" . $sourceEntity."#".$associationName."'.");
}
+ /**
+ * @param array $cascades
+ * @param string $className
+ * @param string $propertyName
+ *
+ * @return MappingException
+ */
public static function invalidCascadeOption(array $cascades, $className, $propertyName)
{
$cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades));
diff --git a/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php b/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php
index f0192ae25..f336c9917 100644
--- a/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php
+++ b/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php
@@ -31,7 +31,6 @@ namespace Doctrine\ORM\Mapping;
*/
final class NamedNativeQuery implements Annotation
{
-
/**
* The name used to refer to the query with the EntityManager methods that create query objects.
*
@@ -59,5 +58,4 @@ final class NamedNativeQuery implements Annotation
* @var string
*/
public $resultSetMapping;
-
}
diff --git a/lib/Doctrine/ORM/Mapping/NamedQueries.php b/lib/Doctrine/ORM/Mapping/NamedQueries.php
index 14bb47952..5fce0727b 100644
--- a/lib/Doctrine/ORM/Mapping/NamedQueries.php
+++ b/lib/Doctrine/ORM/Mapping/NamedQueries.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class NamedQueries implements Annotation
{
- /** @var array<\Doctrine\ORM\Mapping\NamedQuery> */
+ /**
+ * @var array<\Doctrine\ORM\Mapping\NamedQuery>
+ */
public $value;
}
diff --git a/lib/Doctrine/ORM/Mapping/NamedQuery.php b/lib/Doctrine/ORM/Mapping/NamedQuery.php
index 282682082..c4e6cd528 100644
--- a/lib/Doctrine/ORM/Mapping/NamedQuery.php
+++ b/lib/Doctrine/ORM/Mapping/NamedQuery.php
@@ -25,8 +25,13 @@ namespace Doctrine\ORM\Mapping;
*/
final class NamedQuery implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $query;
}
diff --git a/lib/Doctrine/ORM/Mapping/NamingStrategy.php b/lib/Doctrine/ORM/Mapping/NamingStrategy.php
index 73e289b75..fc66905c5 100644
--- a/lib/Doctrine/ORM/Mapping/NamingStrategy.php
+++ b/lib/Doctrine/ORM/Mapping/NamingStrategy.php
@@ -31,53 +31,58 @@ namespace Doctrine\ORM\Mapping;
interface NamingStrategy
{
/**
- * Return a table name for an entity class
+ * Returns a table name for an entity class.
*
- * @param string $className The fully-qualified class name
- * @return string A table name
+ * @param string $className The fully-qualified class name.
+ *
+ * @return string A table name.
*/
function classToTableName($className);
/**
- * Return a column name for a property
+ * Returns a column name for a property.
*
- * @param string $propertyName A property
- * @param string $className The fully-qualified class name
- * @return string A column name
+ * @param string $propertyName A property name.
+ * @param string|null $className The fully-qualified class name.
+ *
+ * @return string A column name.
*/
function propertyToColumnName($propertyName, $className = null);
/**
- * Return the default reference column name
+ * Returns the default reference column name.
*
- * @return string A column name
+ * @return string A column name.
*/
function referenceColumnName();
/**
- * Return a join column name for a property
+ * Returns a join column name for a property.
*
- * @param string $propertyName A property
- * @return string A join column name
+ * @param string $propertyName A property name.
+ *
+ * @return string A join column name.
*/
function joinColumnName($propertyName);
/**
- * Return a join table name
+ * Returns a join table name.
*
- * @param string $sourceEntity The source entity
- * @param string $targetEntity The target entity
- * @param string $propertyName A property
- * @return string A join table name
+ * @param string $sourceEntity The source entity.
+ * @param string $targetEntity The target entity.
+ * @param string|null $propertyName A property name.
+ *
+ * @return string A join table name.
*/
function joinTableName($sourceEntity, $targetEntity, $propertyName = null);
/**
- * Return the foreign key column name for the given parameters
+ * Returns the foreign key column name for the given parameters.
*
- * @param string $entityName A entity
- * @param string $referencedColumnName A property
- * @return string A join column name
+ * @param string $entityName An entity.
+ * @param string|null $referencedColumnName A property.
+ *
+ * @return string A join column name.
*/
function joinKeyColumnName($entityName, $referencedColumnName = null);
}
diff --git a/lib/Doctrine/ORM/Mapping/OneToMany.php b/lib/Doctrine/ORM/Mapping/OneToMany.php
index 63096a0e6..4b2465718 100644
--- a/lib/Doctrine/ORM/Mapping/OneToMany.php
+++ b/lib/Doctrine/ORM/Mapping/OneToMany.php
@@ -41,7 +41,9 @@ final class OneToMany implements Annotation
public $cascade;
/**
- * @var string The fetching strategy to use for the association.
+ * The fetching strategy to use for the association.
+ *
+ * @var string
*
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/OneToOne.php b/lib/Doctrine/ORM/Mapping/OneToOne.php
index 4153976f1..b2ab81f88 100644
--- a/lib/Doctrine/ORM/Mapping/OneToOne.php
+++ b/lib/Doctrine/ORM/Mapping/OneToOne.php
@@ -46,7 +46,9 @@ final class OneToOne implements Annotation
public $cascade;
/**
- * @var string The fetching strategy to use for the association.
+ * The fetching strategy to use for the association.
+ *
+ * @var string
*
* @Enum({"LAZY", "EAGER", "EXTRA_LAZY"})
*/
diff --git a/lib/Doctrine/ORM/Mapping/OrderBy.php b/lib/Doctrine/ORM/Mapping/OrderBy.php
index 40419733e..ad1b7a8f7 100644
--- a/lib/Doctrine/ORM/Mapping/OrderBy.php
+++ b/lib/Doctrine/ORM/Mapping/OrderBy.php
@@ -25,6 +25,8 @@ namespace Doctrine\ORM\Mapping;
*/
final class OrderBy implements Annotation
{
- /** @var array */
+ /**
+ * @var array
+ */
public $value;
}
diff --git a/lib/Doctrine/ORM/Mapping/QuoteStrategy.php b/lib/Doctrine/ORM/Mapping/QuoteStrategy.php
index 52e846d99..2ad7e7c97 100644
--- a/lib/Doctrine/ORM/Mapping/QuoteStrategy.php
+++ b/lib/Doctrine/ORM/Mapping/QuoteStrategy.php
@@ -23,7 +23,7 @@ use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/**
- * A set of rules for determining the column, alias and table quotes
+ * A set of rules for determining the column, alias and table quotes.
*
* @since 2.3
* @author Fabio B. Silva
@@ -33,80 +33,88 @@ interface QuoteStrategy
/**
* Gets the (possibly quoted) column name for safe use in an SQL statement.
*
- * @param string $fieldName
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param string $fieldName
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) primary table name for safe use in an SQL statement.
*
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getTableName(ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) sequence name for safe use in an SQL statement.
*
- * @param array $definition
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param array $definition
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) name of the join table.
*
- * @param array $association
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param array $association
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) join column name.
*
- * @param array $joinColumn
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param array $joinColumn
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) join column name.
*
- * @param array $joinColumn
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return string
+ * @param array $joinColumn
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return string
*/
function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the (possibly quoted) identifier column names for safe use in an SQL statement.
*
- * @param ClassMetadata $class
- * @param AbstractPlatform $platform
- * @return array
+ * @param ClassMetadata $class
+ * @param AbstractPlatform $platform
+ *
+ * @return array
*/
function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform);
/**
* Gets the column alias.
*
- * @param string $columnName
- * @param integer $counter
- * @param AbstractPlatform $platform
- * @param ClassMetadata $class
- * @return string
+ * @param string $columnName
+ * @param integer $counter
+ * @param AbstractPlatform $platform
+ * @param ClassMetadata|null $class
+ *
+ * @return string
*/
function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null);
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Mapping/SequenceGenerator.php b/lib/Doctrine/ORM/Mapping/SequenceGenerator.php
index 1acb498bc..ba1c45b64 100644
--- a/lib/Doctrine/ORM/Mapping/SequenceGenerator.php
+++ b/lib/Doctrine/ORM/Mapping/SequenceGenerator.php
@@ -25,10 +25,18 @@ namespace Doctrine\ORM\Mapping;
*/
final class SequenceGenerator implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $sequenceName;
- /** @var integer */
+
+ /**
+ * @var integer
+ */
public $allocationSize = 1;
- /** @var integer */
+
+ /**
+ * @var integer
+ */
public $initialValue = 1;
}
diff --git a/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php b/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php
index 881e873ed..f5ead7c0f 100644
--- a/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php
+++ b/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php
@@ -31,7 +31,6 @@ namespace Doctrine\ORM\Mapping;
*/
final class SqlResultSetMapping implements Annotation
{
-
/**
* The name given to the result set mapping, and used to refer to it in the methods of the Query API.
*
@@ -52,5 +51,4 @@ final class SqlResultSetMapping implements Annotation
* @var array<\Doctrine\ORM\Mapping\ColumnResult>
*/
public $columns = array();
-
}
diff --git a/lib/Doctrine/ORM/Mapping/Table.php b/lib/Doctrine/ORM/Mapping/Table.php
index 8f94f0c87..f9f8d4a65 100644
--- a/lib/Doctrine/ORM/Mapping/Table.php
+++ b/lib/Doctrine/ORM/Mapping/Table.php
@@ -25,14 +25,28 @@ namespace Doctrine\ORM\Mapping;
*/
final class Table implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var string */
+
+ /**
+ * @var string
+ */
public $schema;
- /** @var array<\Doctrine\ORM\Mapping\Index> */
+
+ /**
+ * @var array<\Doctrine\ORM\Mapping\Index>
+ */
public $indexes;
- /** @var array<\Doctrine\ORM\Mapping\UniqueConstraint> */
+
+ /**
+ * @var array<\Doctrine\ORM\Mapping\UniqueConstraint>
+ */
public $uniqueConstraints;
- /** @var array */
+
+ /**
+ * @var array
+ */
public $options = array();
}
diff --git a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
index 49a04feeb..5231aaafc 100644
--- a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
+++ b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
@@ -37,7 +37,7 @@ class UnderscoreNamingStrategy implements NamingStrategy
private $case;
/**
- * Underscore naming strategy construct
+ * Underscore naming strategy construct.
*
* @param integer $case CASE_LOWER | CASE_UPPER
*/
@@ -47,7 +47,7 @@ class UnderscoreNamingStrategy implements NamingStrategy
}
/**
- * @return integer
+ * @return integer CASE_LOWER | CASE_UPPER
*/
public function getCase()
{
@@ -55,10 +55,12 @@ class UnderscoreNamingStrategy implements NamingStrategy
}
/**
- * Sets string case CASE_LOWER | CASE_UPPER
- * Alphabetic characters converted to lowercase or uppercase
+ * Sets string case CASE_LOWER | CASE_UPPER.
+ * Alphabetic characters converted to lowercase or uppercase.
*
* @param integer $case
+ *
+ * @return void
*/
public function setCase($case)
{
@@ -120,6 +122,7 @@ class UnderscoreNamingStrategy implements NamingStrategy
/**
* @param string $string
+ *
* @return string
*/
private function underscore($string)
diff --git a/lib/Doctrine/ORM/Mapping/UniqueConstraint.php b/lib/Doctrine/ORM/Mapping/UniqueConstraint.php
index 7df2a2ce8..95d99293f 100644
--- a/lib/Doctrine/ORM/Mapping/UniqueConstraint.php
+++ b/lib/Doctrine/ORM/Mapping/UniqueConstraint.php
@@ -25,8 +25,13 @@ namespace Doctrine\ORM\Mapping;
*/
final class UniqueConstraint implements Annotation
{
- /** @var string */
+ /**
+ * @var string
+ */
public $name;
- /** @var array */
+
+ /**
+ * @var array
+ */
public $columns;
}
diff --git a/lib/Doctrine/ORM/NativeQuery.php b/lib/Doctrine/ORM/NativeQuery.php
index 1b9b02229..b19f81805 100644
--- a/lib/Doctrine/ORM/NativeQuery.php
+++ b/lib/Doctrine/ORM/NativeQuery.php
@@ -27,12 +27,16 @@ namespace Doctrine\ORM;
*/
final class NativeQuery extends AbstractQuery
{
+ /**
+ * @var string
+ */
private $_sql;
/**
* Sets the SQL of the query.
*
* @param string $sql
+ *
* @return NativeQuery This query instance.
*/
public function setSQL($sql)
@@ -46,6 +50,7 @@ final class NativeQuery extends AbstractQuery
* Gets the SQL query.
*
* @return mixed The built SQL query or an array of all SQL queries.
+ *
* @override
*/
public function getSQL()
diff --git a/lib/Doctrine/ORM/NoResultException.php b/lib/Doctrine/ORM/NoResultException.php
index 682cb3a64..2cbac8e9d 100644
--- a/lib/Doctrine/ORM/NoResultException.php
+++ b/lib/Doctrine/ORM/NoResultException.php
@@ -27,6 +27,9 @@ namespace Doctrine\ORM;
*/
class NoResultException extends UnexpectedResultException
{
+ /**
+ * Constructor.
+ */
public function __construct()
{
parent::__construct('No result was found for query although at least one row was expected.');
diff --git a/lib/Doctrine/ORM/NonUniqueResultException.php b/lib/Doctrine/ORM/NonUniqueResultException.php
index 4523af212..55b713000 100644
--- a/lib/Doctrine/ORM/NonUniqueResultException.php
+++ b/lib/Doctrine/ORM/NonUniqueResultException.php
@@ -27,5 +27,4 @@ namespace Doctrine\ORM;
*/
class NonUniqueResultException extends UnexpectedResultException
{
-
}
diff --git a/lib/Doctrine/ORM/ORMException.php b/lib/Doctrine/ORM/ORMException.php
index 2776753c5..99333f034 100644
--- a/lib/Doctrine/ORM/ORMException.php
+++ b/lib/Doctrine/ORM/ORMException.php
@@ -29,22 +29,41 @@ use Exception;
*/
class ORMException extends Exception
{
+ /**
+ * @return ORMException
+ */
public static function missingMappingDriverImpl()
{
return new self("It's a requirement to specify a Metadata Driver and pass it ".
"to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().");
}
+ /**
+ * @param string $queryName
+ *
+ * @return ORMException
+ */
public static function namedQueryNotFound($queryName)
{
return new self('Could not find a named query by the name "' . $queryName . '"');
}
+ /**
+ * @param string $nativeQueryName
+ *
+ * @return ORMException
+ */
public static function namedNativeQueryNotFound($nativeQueryName)
{
return new self('Could not find a named native query by the name "' . $nativeQueryName . '"');
}
+ /**
+ * @param object $entity
+ * @param object $relatedEntity
+ *
+ * @return ORMException
+ */
public static function entityMissingForeignAssignedId($entity, $relatedEntity)
{
return new self(
@@ -56,6 +75,12 @@ class ORMException extends Exception
);
}
+ /**
+ * @param object $entity
+ * @param string $field
+ *
+ * @return ORMException
+ */
public static function entityMissingAssignedIdForField($entity, $field)
{
return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field '" . $field . "'. " .
@@ -65,6 +90,11 @@ class ORMException extends Exception
);
}
+ /**
+ * @param string $field
+ *
+ * @return ORMException
+ */
public static function unrecognizedField($field)
{
return new self("Unrecognized field: $field");
@@ -73,37 +103,67 @@ class ORMException extends Exception
/**
* @param string $className
* @param string $field
+ *
+ * @return ORMException
*/
public static function invalidOrientation($className, $field)
{
return new self("Invalid order by orientation specified for " . $className . "#" . $field);
}
+ /**
+ * @param string $mode
+ *
+ * @return ORMException
+ */
public static function invalidFlushMode($mode)
{
return new self("'$mode' is an invalid flush mode.");
}
+ /**
+ * @return ORMException
+ */
public static function entityManagerClosed()
{
return new self("The EntityManager is closed.");
}
+ /**
+ * @param string $mode
+ *
+ * @return ORMException
+ */
public static function invalidHydrationMode($mode)
{
return new self("'$mode' is an invalid hydration mode.");
}
+ /**
+ * @return ORMException
+ */
public static function mismatchedEventManager()
{
return new self("Cannot use different EventManager instances for EntityManager and Connection.");
}
+ /**
+ * @param string $methodName
+ *
+ * @return ORMException
+ */
public static function findByRequiresParameter($methodName)
{
return new self("You need to pass a parameter to '".$methodName."'");
}
+ /**
+ * @param string $entityName
+ * @param string $fieldName
+ * @param string $method
+ *
+ * @return ORMException
+ */
public static function invalidFindByCall($entityName, $fieldName, $method)
{
return new self(
@@ -112,6 +172,12 @@ class ORMException extends Exception
);
}
+ /**
+ * @param string $entityName
+ * @param string $associationFieldName
+ *
+ * @return ORMException
+ */
public static function invalidFindByInverseAssociation($entityName, $associationFieldName)
{
return new self(
@@ -120,29 +186,51 @@ class ORMException extends Exception
);
}
- public static function invalidResultCacheDriver() {
+ /**
+ * @return ORMException
+ */
+ public static function invalidResultCacheDriver()
+ {
return new self("Invalid result cache driver; it must implement Doctrine\\Common\\Cache\\Cache.");
}
- public static function notSupported() {
+ /**
+ * @return ORMException
+ */
+ public static function notSupported()
+ {
return new self("This behaviour is (currently) not supported by Doctrine 2");
}
+ /**
+ * @return ORMException
+ */
public static function queryCacheNotConfigured()
{
return new self('Query Cache is not configured.');
}
+ /**
+ * @return ORMException
+ */
public static function metadataCacheNotConfigured()
{
return new self('Class Metadata Cache is not configured.');
}
+ /**
+ * @return ORMException
+ */
public static function proxyClassesAlwaysRegenerating()
{
return new self('Proxy Classes are always regenerating.');
}
+ /**
+ * @param string $entityNamespaceAlias
+ *
+ * @return ORMException
+ */
public static function unknownEntityNamespace($entityNamespaceAlias)
{
return new self(
@@ -150,16 +238,32 @@ class ORMException extends Exception
);
}
+ /**
+ * @param string $className
+ *
+ * @return ORMException
+ */
public static function invalidEntityRepository($className)
{
return new self("Invalid repository class '".$className."'. It must be a Doctrine\Common\Persistence\ObjectRepository.");
}
+ /**
+ * @param string $className
+ * @param string $fieldName
+ *
+ * @return ORMException
+ */
public static function missingIdentifierField($className, $fieldName)
{
return new self("The identifier $fieldName is missing for a query of " . $className);
}
+ /**
+ * @param string $functionName
+ *
+ * @return ORMException
+ */
public static function overwriteInternalDQLFunctionNotAllowed($functionName)
{
return new self("It is not allowed to overwrite internal function '$functionName' in the DQL parser through user-defined functions.");
diff --git a/lib/Doctrine/ORM/ORMInvalidArgumentException.php b/lib/Doctrine/ORM/ORMInvalidArgumentException.php
index c5df4d2fa..1773df291 100644
--- a/lib/Doctrine/ORM/ORMInvalidArgumentException.php
+++ b/lib/Doctrine/ORM/ORMInvalidArgumentException.php
@@ -26,21 +26,42 @@ namespace Doctrine\ORM;
*/
class ORMInvalidArgumentException extends \InvalidArgumentException
{
+ /**
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function scheduleInsertForManagedEntity($entity)
{
return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
}
+ /**
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function scheduleInsertForRemovedEntity($entity)
{
return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
}
+ /**
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function scheduleInsertTwice($entity)
{
return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice.");
}
+ /**
+ * @param string $className
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function entityWithoutIdentity($className, $entity)
{
return new self(
@@ -49,11 +70,22 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
);
}
+ /**
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function readOnlyRequiresManagedEntity($entity)
{
return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not");
}
+ /**
+ * @param array $assoc
+ * @param object $entry
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function newEntityFoundThroughRelationship(array $assoc, $entry)
{
return new self("A new entity was found through the relationship '"
@@ -68,6 +100,12 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
." implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue."));
}
+ /**
+ * @param array $assoc
+ * @param object $entry
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function detachedEntityFoundThroughRelationship(array $assoc, $entry)
{
return new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") "
@@ -75,39 +113,75 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
. "during cascading a persist operation.");
}
+ /**
+ * @param object $entity
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function entityNotManaged($entity)
{
return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " .
"from the database or registered as new through EntityManager#persist");
}
+ /**
+ * @param object $entity
+ * @param string $operation
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function entityHasNoIdentity($entity, $operation)
{
return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
}
+ /**
+ * @param object $entity
+ * @param string $operation
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function entityIsRemoved($entity, $operation)
{
return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
}
+ /**
+ * @param object $entity
+ * @param string $operation
+ *
+ * @return ORMInvalidArgumentException
+ */
static public function detachedEntityCannot($entity, $operation)
{
return new self("A detached entity was found during " . $operation . " " . self::objToStr($entity));
}
+ /**
+ * @param string $context
+ * @param mixed $given
+ * @param int $parameterIndex
+ *
+ * @return ORMInvalidArgumentException
+ */
public static function invalidObject($context, $given, $parameterIndex = 1)
{
- return new self($context .' expects parameter ' . $parameterIndex .
+ return new self($context . ' expects parameter ' . $parameterIndex .
' to be an entity object, '. gettype($given) . ' given.');
}
+ /**
+ * @return ORMInvalidArgumentException
+ */
public static function invalidCompositeIdentifier()
{
return new self("Binding an entity with a composite primary key to a query is not supported. " .
"You should split the parameter into the explicit fields and bind them seperately.");
}
+ /**
+ * @return ORMInvalidArgumentException
+ */
public static function invalidIdentifierBindingEntity()
{
return new self("Binding entities to query parameters only allowed for entities that have an identifier.");
@@ -116,7 +190,8 @@ class ORMInvalidArgumentException extends \InvalidArgumentException
/**
* Helper method to show an object as string.
*
- * @param object $obj
+ * @param object $obj
+ *
* @return string
*/
private static function objToStr($obj)
diff --git a/lib/Doctrine/ORM/OptimisticLockException.php b/lib/Doctrine/ORM/OptimisticLockException.php
index b425ac39e..6f1a57631 100644
--- a/lib/Doctrine/ORM/OptimisticLockException.php
+++ b/lib/Doctrine/ORM/OptimisticLockException.php
@@ -29,8 +29,15 @@ namespace Doctrine\ORM;
*/
class OptimisticLockException extends ORMException
{
+ /**
+ * @var object|null
+ */
private $entity;
+ /**
+ * @param string $msg
+ * @param object $entity
+ */
public function __construct($msg, $entity)
{
parent::__construct($msg);
@@ -40,23 +47,40 @@ class OptimisticLockException extends ORMException
/**
* Gets the entity that caused the exception.
*
- * @return object
+ * @return object|null
*/
public function getEntity()
{
return $this->entity;
}
+ /**
+ * @param object $entity
+ *
+ * @return OptimisticLockException
+ */
public static function lockFailed($entity)
{
return new self("The optimistic lock on an entity failed.", $entity);
}
+ /**
+ * @param object $entity
+ * @param int $expectedLockVersion
+ * @param int $actualLockVersion
+ *
+ * @return OptimisticLockException
+ */
public static function lockFailedVersionMissmatch($entity, $expectedLockVersion, $actualLockVersion)
{
return new self("The optimistic lock failed, version " . $expectedLockVersion . " was expected, but is actually ".$actualLockVersion, $entity);
}
+ /**
+ * @param string $entityName
+ *
+ * @return OptimisticLockException
+ */
public static function notVersioned($entityName)
{
return new self("Cannot obtain optimistic lock on unversioned entity " . $entityName, null);
diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php
index 8c306f4ab..a7d4abb3f 100644
--- a/lib/Doctrine/ORM/PersistentCollection.php
+++ b/lib/Doctrine/ORM/PersistentCollection.php
@@ -25,7 +25,6 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\Common\Collections\Criteria;
-use Doctrine\Common\Collections\ExpressionBuilder;
use Closure;
@@ -87,6 +86,8 @@ final class PersistentCollection implements Collection, Selectable
/**
* The class descriptor of the collection's entity type.
+ *
+ * @var ClassMetadata
*/
private $typeClass;
@@ -115,9 +116,9 @@ final class PersistentCollection implements Collection, Selectable
/**
* Creates a new persistent collection.
*
- * @param EntityManager $em The EntityManager the collection will be associated with.
+ * @param EntityManager $em The EntityManager the collection will be associated with.
* @param ClassMetadata $class The class descriptor of the entity type of this collection.
- * @param array The collection elements.
+ * @param array $coll The collection elements.
*/
public function __construct(EntityManager $em, $class, $coll)
{
@@ -132,7 +133,9 @@ final class PersistentCollection implements Collection, Selectable
* describes the association between the owner and the elements of the collection.
*
* @param object $entity
- * @param AssociationMapping $assoc
+ * @param array $assoc
+ *
+ * @return void
*/
public function setOwner($entity, array $assoc)
{
@@ -152,6 +155,9 @@ final class PersistentCollection implements Collection, Selectable
return $this->owner;
}
+ /**
+ * @return Mapping\ClassMetadata
+ */
public function getTypeClass()
{
return $this->typeClass;
@@ -163,6 +169,8 @@ final class PersistentCollection implements Collection, Selectable
* complete bidirectional associations in the case of a one-to-many association.
*
* @param mixed $element The element to add.
+ *
+ * @return void
*/
public function hydrateAdd($element)
{
@@ -186,8 +194,10 @@ final class PersistentCollection implements Collection, Selectable
* INTERNAL:
* Sets a keyed element in the collection during hydration.
*
- * @param mixed $key The key to set.
- * $param mixed $value The element to set.
+ * @param mixed $key The key to set.
+ * @param mixed $element The element to set.
+ *
+ * @return void
*/
public function hydrateSet($key, $element)
{
@@ -206,6 +216,8 @@ final class PersistentCollection implements Collection, Selectable
/**
* Initializes the collection by loading its contents from the database
* if the collection is not yet initialized.
+ *
+ * @return void
*/
public function initialize()
{
@@ -239,6 +251,8 @@ final class PersistentCollection implements Collection, Selectable
/**
* INTERNAL:
* Tells this collection to take a snapshot of its current state.
+ *
+ * @return void
*/
public function takeSnapshot()
{
@@ -299,6 +313,8 @@ final class PersistentCollection implements Collection, Selectable
/**
* Marks this collection as changed/dirty.
+ *
+ * @return void
*/
private function changed()
{
@@ -332,6 +348,8 @@ final class PersistentCollection implements Collection, Selectable
* Sets a boolean flag, indicating whether this collection is dirty.
*
* @param boolean $dirty Whether the collection should be marked dirty or not.
+ *
+ * @return void
*/
public function setDirty($dirty)
{
@@ -342,6 +360,8 @@ final class PersistentCollection implements Collection, Selectable
* Sets the initialized flag of the collection, forcing it into that state.
*
* @param boolean $bool
+ *
+ * @return void
*/
public function setInitialized($bool)
{
@@ -358,7 +378,9 @@ final class PersistentCollection implements Collection, Selectable
return $this->initialized;
}
- /** {@inheritdoc} */
+ /**
+ * {@inheritdoc}
+ */
public function first()
{
$this->initialize();
@@ -366,7 +388,9 @@ final class PersistentCollection implements Collection, Selectable
return $this->coll->first();
}
- /** {@inheritdoc} */
+ /**
+ * {@inheritdoc}
+ */
public function last()
{
$this->initialize();
@@ -668,6 +692,8 @@ final class PersistentCollection implements Collection, Selectable
* Called by PHP when this collection is serialized. Ensures that only the
* elements are properly serialized.
*
+ * @return array
+ *
* @internal Tried to implement Serializable first but that did not work well
* with circular references. This solution seems simpler and works well.
*/
@@ -679,7 +705,7 @@ final class PersistentCollection implements Collection, Selectable
/* ArrayAccess implementation */
/**
- * @see containsKey()
+ * {@inheritdoc}
*/
public function offsetExists($offset)
{
@@ -687,7 +713,7 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * @see get()
+ * {@inheritdoc}
*/
public function offsetGet($offset)
{
@@ -695,8 +721,7 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * @see add()
- * @see set()
+ * {@inheritdoc}
*/
public function offsetSet($offset, $value)
{
@@ -708,20 +733,23 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * @see remove()
+ * {@inheritdoc}
*/
public function offsetUnset($offset)
{
return $this->remove($offset);
}
+ /**
+ * {@inheritdoc}
+ */
public function key()
{
return $this->coll->key();
}
/**
- * Gets the element of the collection at the current iterator position.
+ * {@inheritdoc}
*/
public function current()
{
@@ -729,7 +757,7 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * Moves the internal iterator position to the next element.
+ * {@inheritdoc}
*/
public function next()
{
@@ -747,14 +775,14 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * Extract a slice of $length elements starting at position $offset from the Collection.
+ * Extracts a slice of $length elements starting at position $offset from the Collection.
*
* If $length is null it returns all elements from $offset to the end of the Collection.
* Keys have to be preserved by this method. Calling this method will only return the
* selected slice and NOT change the elements contained in the collection slice is called on.
*
- * @param int $offset
- * @param int $length
+ * @param int $offset
+ * @param int|null $length
*
* @return array
*/
@@ -772,7 +800,7 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * Cleanup internal state of cloned persistent collection.
+ * Cleans up internal state of cloned persistent collection.
*
* The following problems have to be prevented:
* 1. Added entities are added to old PC
@@ -781,6 +809,8 @@ final class PersistentCollection implements Collection, Selectable
* 3. Snapshot leads to invalid diffs being generated.
* 4. Lazy loading grabs entities from old owner object.
* 5. New collection is connected to old owner and leads to duplicate keys.
+ *
+ * @return void
*/
public function __clone()
{
@@ -797,11 +827,14 @@ final class PersistentCollection implements Collection, Selectable
}
/**
- * Select all elements from a selectable that match the expression and
+ * Selects all elements from a selectable that match the expression and
* return a new collection containing these elements.
*
* @param \Doctrine\Common\Collections\Criteria $criteria
+ *
* @return Collection
+ *
+ * @throws \RuntimeException
*/
public function matching(Criteria $criteria)
{
@@ -835,4 +868,3 @@ final class PersistentCollection implements Collection, Selectable
return new ArrayCollection(array_merge($persister->loadCriteria($criteria), $newObjects));
}
}
-
diff --git a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php
index f6c004e5d..e1cad36bc 100644
--- a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php
+++ b/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php
@@ -77,6 +77,8 @@ abstract class AbstractCollectionPersister
* Deletes the persistent state represented by the given collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
public function delete(PersistentCollection $coll)
{
@@ -95,6 +97,8 @@ abstract class AbstractCollectionPersister
* Gets the SQL statement for deleting the given collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
abstract protected function getDeleteSQL(PersistentCollection $coll);
@@ -103,14 +107,18 @@ abstract class AbstractCollectionPersister
* the given collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
abstract protected function getDeleteSQLParameters(PersistentCollection $coll);
/**
- * Updates the given collection, synchronizing it's state with the database
+ * Updates the given collection, synchronizing its state with the database
* by inserting, updating and deleting individual elements.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
public function update(PersistentCollection $coll)
{
@@ -125,9 +133,11 @@ abstract class AbstractCollectionPersister
}
/**
- * Delete rows
+ * Deletes rows.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
public function deleteRows(PersistentCollection $coll)
{
@@ -140,9 +150,11 @@ abstract class AbstractCollectionPersister
}
/**
- * Insert rows
+ * Inserts rows.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return void
*/
public function insertRows(PersistentCollection $coll)
{
@@ -155,11 +167,13 @@ abstract class AbstractCollectionPersister
}
/**
- * Count the size of this persistent collection
+ * Counts the size of this persistent collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
*
* @return integer
+ *
+ * @throws \BadMethodCallException
*/
public function count(PersistentCollection $coll)
{
@@ -167,13 +181,15 @@ abstract class AbstractCollectionPersister
}
/**
- * Slice elements
+ * Slices elements.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param integer $offset
- * @param integer $length
+ * @param integer $offset
+ * @param integer $length
*
* @return array
+ *
+ * @throws \BadMethodCallException
*/
public function slice(PersistentCollection $coll, $offset, $length = null)
{
@@ -181,38 +197,44 @@ abstract class AbstractCollectionPersister
}
/**
- * Check for existance of an element
+ * Checks for existence of an element.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
*
* @return boolean
+ *
+ * @throws \BadMethodCallException
*/
public function contains(PersistentCollection $coll, $element)
{
- throw new \BadMethodCallException("Checking for existance of an element is not supported by this CollectionPersister.");
+ throw new \BadMethodCallException("Checking for existence of an element is not supported by this CollectionPersister.");
}
/**
- * Check for existance of a key
+ * Checks for existence of a key.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param mixed $key
+ * @param mixed $key
*
* @return boolean
+ *
+ * @throws \BadMethodCallException
*/
public function containsKey(PersistentCollection $coll, $key)
{
- throw new \BadMethodCallException("Checking for existance of a key is not supported by this CollectionPersister.");
+ throw new \BadMethodCallException("Checking for existence of a key is not supported by this CollectionPersister.");
}
/**
- * Remove an element
+ * Removes an element.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
*
* @return mixed
+ *
+ * @throws \BadMethodCallException
*/
public function removeElement(PersistentCollection $coll, $element)
{
@@ -220,11 +242,14 @@ abstract class AbstractCollectionPersister
}
/**
- * Remove an element by key
+ * Removes an element by key.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- *
- * @param mixed $key
+ * @param mixed $key
+ *
+ * @return void
+ *
+ * @throws \BadMethodCallException
*/
public function removeKey(PersistentCollection $coll, $key)
{
@@ -232,12 +257,14 @@ abstract class AbstractCollectionPersister
}
/**
- * Get an element by key
+ * Gets an element by key.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param mixed $index
+ * @param mixed $index
*
* @return mixed
+ *
+ * @throws \BadMethodCallException
*/
public function get(PersistentCollection $coll, $index)
{
@@ -248,6 +275,8 @@ abstract class AbstractCollectionPersister
* Gets the SQL statement used for deleting a row from the collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return string
*/
abstract protected function getDeleteRowSQL(PersistentCollection $coll);
@@ -256,7 +285,9 @@ abstract class AbstractCollectionPersister
* element from the given collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param mixed $element
+ * @param mixed $element
+ *
+ * @return array
*/
abstract protected function getDeleteRowSQLParameters(PersistentCollection $coll, $element);
@@ -264,6 +295,8 @@ abstract class AbstractCollectionPersister
* Gets the SQL statement used for updating a row in the collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return string
*/
abstract protected function getUpdateRowSQL(PersistentCollection $coll);
@@ -271,6 +304,8 @@ abstract class AbstractCollectionPersister
* Gets the SQL statement used for inserting a row in the collection.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
+ * @return string
*/
abstract protected function getInsertRowSQL(PersistentCollection $coll);
@@ -279,7 +314,9 @@ abstract class AbstractCollectionPersister
* element of the given collection into the database.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param mixed $element
+ * @param mixed $element
+ *
+ * @return array
*/
abstract protected function getInsertRowSQLParameters(PersistentCollection $coll, $element);
}
diff --git a/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php b/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php
index d0f7151f3..422249579 100644
--- a/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php
+++ b/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php
@@ -76,6 +76,13 @@ abstract class AbstractEntityInheritancePersister extends BasicEntityPersister
return $sql . ' AS ' . $columnAlias;
}
+ /**
+ * @param string $tableAlias
+ * @param string $joinColumnName
+ * @param string $className
+ *
+ * @return string
+ */
protected function getSelectJoinColumnSQL($tableAlias, $joinColumnName, $className)
{
$columnAlias = $this->getSQLColumnAlias($joinColumnName);
diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
index b33feffb4..c6c2a0165 100644
--- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
+++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
@@ -144,6 +144,7 @@ class BasicEntityPersister
* when INSERTing or UPDATEing an entity.
*
* @var array
+ *
* @see prepareInsertData($entity)
* @see prepareUpdateData($entity)
*/
@@ -153,6 +154,7 @@ class BasicEntityPersister
* The map of quoted column names.
*
* @var array
+ *
* @see prepareInsertData($entity)
* @see prepareUpdateData($entity)
*/
@@ -207,7 +209,7 @@ class BasicEntityPersister
* Initializes a new BasicEntityPersister that uses the given EntityManager
* and persists instances of the class described by the given ClassMetadata descriptor.
*
- * @param \Doctrine\ORM\EntityManager $em
+ * @param \Doctrine\ORM\EntityManager $em
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
*/
public function __construct(EntityManager $em, ClassMetadata $class)
@@ -232,6 +234,8 @@ class BasicEntityPersister
* The entity remains queued until {@link executeInserts} is invoked.
*
* @param object $entity The entity to queue for insertion.
+ *
+ * @return void
*/
public function addInsert($entity)
{
@@ -297,7 +301,9 @@ class BasicEntityPersister
* entities version field.
*
* @param object $entity
- * @param mixed $id
+ * @param mixed $id
+ *
+ * @return void
*/
protected function assignDefaultVersionValue($entity, $id)
{
@@ -307,10 +313,11 @@ class BasicEntityPersister
}
/**
- * Fetch the current version value of a versioned entity.
+ * Fetches the current version value of a versioned entity.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $versionedClass
- * @param mixed $id
+ * @param mixed $id
+ *
* @return mixed
*/
protected function fetchVersionValue($versionedClass, $id)
@@ -343,6 +350,8 @@ class BasicEntityPersister
* from {@prepareUpdateData} on the target tables, thereby optionally applying versioning.
*
* @param object $entity The entity to update.
+ *
+ * @return void
*/
public function update($entity)
{
@@ -369,10 +378,15 @@ class BasicEntityPersister
* Performs an UPDATE statement for an entity on a specific table.
* The UPDATE can optionally be versioned, which requires the entity to have a version field.
*
- * @param object $entity The entity object being updated.
- * @param string $quotedTableName The quoted name of the table to apply the UPDATE on.
- * @param array $updateData The map of columns to update (column => value).
- * @param boolean $versioned Whether the UPDATE should be versioned.
+ * @param object $entity The entity object being updated.
+ * @param string $quotedTableName The quoted name of the table to apply the UPDATE on.
+ * @param array $updateData The map of columns to update (column => value).
+ * @param boolean $versioned Whether the UPDATE should be versioned.
+ *
+ * @return void
+ *
+ * @throws \Doctrine\ORM\ORMException
+ * @throws \Doctrine\ORM\OptimisticLockException
*/
protected final function updateTable($entity, $quotedTableName, array $updateData, $versioned = false)
{
@@ -472,7 +486,9 @@ class BasicEntityPersister
/**
* @todo Add check for platform if it supports foreign keys/cascading.
+ *
* @param array $identifier
+ *
* @return void
*/
protected function deleteJoinTableRecords($identifier)
@@ -538,6 +554,8 @@ class BasicEntityPersister
* Subclasses may override this method to customize the semantics of entity deletion.
*
* @param object $entity The entity to delete.
+ *
+ * @return void
*/
public function delete($entity)
{
@@ -568,6 +586,7 @@ class BasicEntityPersister
*
*
* @param object $entity The entity for which to prepare the data.
+ *
* @return array The prepared data.
*/
protected function prepareUpdateData($entity)
@@ -658,7 +677,9 @@ class BasicEntityPersister
* The default insert data preparation is the same as for updates.
*
* @param object $entity The entity for which to prepare the data.
+ *
* @return array The prepared data for the tables to update.
+ *
* @see prepareUpdateData
*/
protected function prepareInsertData($entity)
@@ -674,6 +695,7 @@ class BasicEntityPersister
* is always persisted to a single table with a BasicEntityPersister.
*
* @param string $fieldName The field name.
+ *
* @return string The table name.
*/
public function getOwningTable($fieldName)
@@ -684,15 +706,16 @@ class BasicEntityPersister
/**
* Loads an entity by a list of field criteria.
*
- * @param array $criteria The criteria by which to load the entity.
- * @param object $entity The entity to load the data into. If not specified,
- * a new entity is created.
- * @param $assoc The association that connects the entity to load to another entity, if any.
- * @param array $hints Hints for entity creation.
- * @param int $lockMode
- * @param int $limit Limit number of results
- * @param array $orderBy Criteria to order by
+ * @param array $criteria The criteria by which to load the entity.
+ * @param object|null $entity The entity to load the data into. If not specified, a new entity is created.
+ * @param array|null $assoc The association that connects the entity to load to another entity, if any.
+ * @param array $hints Hints for entity creation.
+ * @param int $lockMode
+ * @param int|null $limit Limit number of results.
+ * @param array|null $orderBy Criteria to order by.
+ *
* @return object The loaded and managed entity instance or NULL if the entity can not be found.
+ *
* @todo Check identity map? loadById method? Try to guess whether $criteria is the id?
*/
public function load(array $criteria, $entity = null, $assoc = null, array $hints = array(), $lockMode = 0, $limit = null, array $orderBy = null)
@@ -716,12 +739,15 @@ class BasicEntityPersister
* Loads an entity of this persister's mapped class as part of a single-valued
* association from another entity.
*
- * @param array $assoc The association to load.
+ * @param array $assoc The association to load.
* @param object $sourceEntity The entity that owns the association (not necessarily the "owning side").
- * @param array $identifier The identifier of the entity to load. Must be provided if
- * the association to load represents the owning side, otherwise
- * the identifier is derived from the $sourceEntity.
+ * @param array $identifier The identifier of the entity to load. Must be provided if
+ * the association to load represents the owning side, otherwise
+ * the identifier is derived from the $sourceEntity.
+ *
* @return object The loaded and managed entity instance or NULL if the entity can not be found.
+ *
+ * @throws \Doctrine\ORM\Mapping\MappingException
*/
public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifier = array())
{
@@ -789,9 +815,12 @@ class BasicEntityPersister
/**
* Refreshes a managed entity.
*
- * @param array $id The identifier of the entity as an associative array from
- * column or field names to values.
- * @param object $entity The entity to refresh.
+ * @param array $id The identifier of the entity as an associative array from
+ * column or field names to values.
+ * @param object $entity The entity to refresh.
+ * @param int $lockMode
+ *
+ * @return void
*/
public function refresh(array $id, $entity, $lockMode = 0)
{
@@ -804,7 +833,7 @@ class BasicEntityPersister
}
/**
- * Load Entities matching the given Criteria object
+ * Loads Entities matching the given Criteria object.
*
* @param \Doctrine\Common\Collections\Criteria $criteria
*
@@ -826,7 +855,7 @@ class BasicEntityPersister
}
/**
- * Expand Criteria Parameters by walking the expressions and grabbing all
+ * Expands Criteria Parameters by walking the expressions and grabbing all
* parameters and types from it.
*
* @param \Doctrine\Common\Collections\Criteria $criteria
@@ -864,10 +893,11 @@ class BasicEntityPersister
/**
* Loads a list of entities by a list of field criteria.
*
- * @param array $criteria
- * @param array $orderBy
- * @param int $limit
- * @param int $offset
+ * @param array $criteria
+ * @param array|null $orderBy
+ * @param int|null $limit
+ * @param int|null $offset
+ *
* @return array
*/
public function loadAll(array $criteria = array(), array $orderBy = null, $limit = null, $offset = null)
@@ -882,12 +912,13 @@ class BasicEntityPersister
}
/**
- * Get (sliced or full) elements of the given collection.
+ * Gets (sliced or full) elements of the given collection.
*
- * @param array $assoc
- * @param object $sourceEntity
+ * @param array $assoc
+ * @param object $sourceEntity
* @param int|null $offset
* @param int|null $limit
+ *
* @return array
*/
public function getManyToManyCollection(array $assoc, $sourceEntity, $offset = null, $limit = null)
@@ -898,9 +929,9 @@ class BasicEntityPersister
}
/**
- * Load an array of entities from a given dbal statement.
+ * Loads an array of entities from a given DBAL statement.
*
- * @param array $assoc
+ * @param array $assoc
* @param \Doctrine\DBAL\Statement $stmt
*
* @return array
@@ -919,11 +950,11 @@ class BasicEntityPersister
}
/**
- * Hydrate a collection from a given dbal statement.
+ * Hydrates a collection from a given DBAL statement.
*
- * @param array $assoc
+ * @param array $assoc
* @param \Doctrine\DBAL\Statement $stmt
- * @param PersistentCollection $coll
+ * @param PersistentCollection $coll
*
* @return array
*/
@@ -946,11 +977,10 @@ class BasicEntityPersister
/**
* Loads a collection of entities of a many-to-many association.
*
- * @param ManyToManyMapping $assoc The association mapping of the association being loaded.
- * @param object $sourceEntity The entity that owns the collection.
- * @param PersistentCollection $coll The collection to fill.
- * @param int|null $offset
- * @param int|null $limit
+ * @param array $assoc The association mapping of the association being loaded.
+ * @param object $sourceEntity The entity that owns the collection.
+ * @param PersistentCollection $coll The collection to fill.
+ *
* @return array
*/
public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
@@ -960,6 +990,16 @@ class BasicEntityPersister
return $this->loadCollectionFromStatement($assoc, $stmt, $coll);
}
+ /**
+ * @param array $assoc
+ * @param object $sourceEntity
+ * @param int|null $offset
+ * @param int|null $limit
+ *
+ * @return \Doctrine\DBAL\Driver\Statement
+ *
+ * @throws \Doctrine\ORM\Mapping\MappingException
+ */
private function getManyToManyStatement(array $assoc, $sourceEntity, $offset = null, $limit = null)
{
$sourceClass = $this->em->getClassMetadata($assoc['sourceEntity']);
@@ -1021,12 +1061,12 @@ class BasicEntityPersister
* Gets the SELECT SQL to select one or more entities by a set of field criteria.
*
* @param array|\Doctrine\Common\Collections\Criteria $criteria
- * @param AssociationMapping $assoc
- * @param string $orderBy
- * @param int $lockMode
- * @param int $limit
- * @param int $offset
- * @param array $orderBy
+ * @param array|null $assoc
+ * @param int $lockMode
+ * @param int|null $limit
+ * @param int|null $offset
+ * @param array|null $orderBy
+ *
* @return string
*/
protected function getSelectSQL($criteria, $assoc = null, $lockMode = 0, $limit = null, $offset = null, array $orderBy = null)
@@ -1089,9 +1129,12 @@ class BasicEntityPersister
/**
* Gets the ORDER BY SQL snippet for ordered collections.
*
- * @param array $orderBy
+ * @param array $orderBy
* @param string $baseTableAlias
+ *
* @return string
+ *
+ * @throws \Doctrine\ORM\ORMException
*/
protected final function getOrderBySQL(array $orderBy, $baseTableAlias)
{
@@ -1235,10 +1278,10 @@ class BasicEntityPersister
/**
* Gets the SQL join fragment used when selecting entities from an association.
*
- * @param string $field
- * @param array $assoc
+ * @param string $field
+ * @param array $assoc
* @param ClassMetadata $class
- * @param string $alias
+ * @param string $alias
*
* @return string
*/
@@ -1267,7 +1310,8 @@ class BasicEntityPersister
* Gets the SQL join fragment used when selecting entities from a
* many-to-many association.
*
- * @param ManyToManyMapping $manyToMany
+ * @param array $manyToMany
+ *
* @return string
*/
protected function getSelectManyToManyJoinSQL(array $manyToMany)
@@ -1381,10 +1425,12 @@ class BasicEntityPersister
/**
* Gets the SQL snippet of a qualified column name for the given field name.
*
- * @param string $field The field name.
+ * @param string $field The field name.
* @param ClassMetadata $class The class that declares this field. The table this class is
* mapped to must own the column for the given field.
- * @param string $alias
+ * @param string $alias
+ *
+ * @return string
*/
protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
{
@@ -1408,7 +1454,10 @@ class BasicEntityPersister
* Gets the SQL table alias for the given class name.
*
* @param string $className
+ * @param string $assocName
+ *
* @return string The SQL table alias.
+ *
* @todo Reconsider. Binding table aliases to class names is not such a good idea.
*/
protected function getSQLTableAlias($className, $assocName = '')
@@ -1429,10 +1478,11 @@ class BasicEntityPersister
}
/**
- * Lock all rows of this entity matching the given criteria with the specified pessimistic lock mode
+ * Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.
*
* @param array $criteria
- * @param int $lockMode
+ * @param int $lockMode
+ *
* @return void
*/
public function lock(array $criteria, $lockMode)
@@ -1464,7 +1514,7 @@ class BasicEntityPersister
}
/**
- * Get the FROM and optionally JOIN conditions to lock the entity managed by this persister.
+ * Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister.
*
* @return string
*/
@@ -1476,9 +1526,10 @@ class BasicEntityPersister
}
/**
- * Get the Select Where Condition from a Criteria object.
+ * Gets the Select Where Condition from a Criteria object.
*
* @param \Doctrine\Common\Collections\Criteria $criteria
+ *
* @return string
*/
protected function getSelectConditionCriteriaSQL(Criteria $criteria)
@@ -1495,12 +1546,12 @@ class BasicEntityPersister
}
/**
- * Get the SQL WHERE condition for matching a field with a given value.
+ * Gets the SQL WHERE condition for matching a field with a given value.
*
- * @param string $field
- * @param mixed $value
- * @param array|null $assoc
- * @param string $comparison
+ * @param string $field
+ * @param mixed $value
+ * @param array|null $assoc
+ * @param string|null $comparison
*
* @return string
*/
@@ -1529,12 +1580,14 @@ class BasicEntityPersister
}
/**
- * Build the left-hand-side of a where condition statement.
+ * Builds the left-hand-side of a where condition statement.
*
- * @param string $field
- * @param array $assoc
+ * @param string $field
+ * @param array|null $assoc
*
* @return string
+ *
+ * @throws \Doctrine\ORM\ORMException
*/
protected function getSelectConditionStatementColumnSQL($field, $assoc = null)
{
@@ -1578,8 +1631,9 @@ class BasicEntityPersister
* Subclasses are supposed to override this method if they intend to change
* or alter the criteria by which entities are selected.
*
- * @param array $criteria
- * @param AssociationMapping $assoc
+ * @param array $criteria
+ * @param array|null $assoc
+ *
* @return string
*/
protected function getSelectConditionSQL(array $criteria, $assoc = null)
@@ -1594,12 +1648,13 @@ class BasicEntityPersister
}
/**
- * Return an array with (sliced or full list) of elements in the specified collection.
+ * Returns an array with (sliced or full list) of elements in the specified collection.
+ *
+ * @param array $assoc
+ * @param object $sourceEntity
+ * @param int|null $offset
+ * @param int|null $limit
*
- * @param array $assoc
- * @param object $sourceEntity
- * @param int $offset
- * @param int $limit
* @return array
*/
public function getOneToManyCollection(array $assoc, $sourceEntity, $offset = null, $limit = null)
@@ -1612,11 +1667,11 @@ class BasicEntityPersister
/**
* Loads a collection of entities in a one-to-many association.
*
- * @param array $assoc
- * @param object $sourceEntity
- * @param PersistentCollection $coll The collection to load/fill.
- * @param int|null $offset
- * @param int|null $limit
+ * @param array $assoc
+ * @param object $sourceEntity
+ * @param PersistentCollection $coll The collection to load/fill.
+ *
+ * @return array
*/
public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll)
{
@@ -1626,12 +1681,13 @@ class BasicEntityPersister
}
/**
- * Build criteria and execute SQL statement to fetch the one to many entities from.
+ * Builds criteria and execute SQL statement to fetch the one to many entities from.
*
- * @param array $assoc
- * @param object $sourceEntity
+ * @param array $assoc
+ * @param object $sourceEntity
* @param int|null $offset
* @param int|null $limit
+ *
* @return \Doctrine\DBAL\Statement
*/
private function getOneToManyStatement(array $assoc, $sourceEntity, $offset = null, $limit = null)
@@ -1667,9 +1723,10 @@ class BasicEntityPersister
}
/**
- * Expand the parameters from the given criteria and use the correct binding types if found.
+ * Expands the parameters from the given criteria and use the correct binding types if found.
+ *
+ * @param array $criteria
*
- * @param array $criteria
* @return array
*/
private function expandParameters($criteria)
@@ -1690,11 +1747,14 @@ class BasicEntityPersister
}
/**
- * Infer field type to be used by parameter type casting.
+ * Infers field type to be used by parameter type casting.
*
* @param string $field
- * @param mixed $value
+ * @param mixed $value
+ *
* @return integer
+ *
+ * @throws \Doctrine\ORM\Query\QueryException
*/
private function getType($field, $value)
{
@@ -1733,9 +1793,10 @@ class BasicEntityPersister
}
/**
- * Retrieve parameter value
+ * Retrieves parameter value.
*
* @param mixed $value
+ *
* @return mixed
*/
private function getValue($value)
@@ -1754,9 +1815,10 @@ class BasicEntityPersister
}
/**
- * Retrieve an individual parameter value
+ * Retrieves an individual parameter value.
*
* @param mixed $value
+ *
* @return mixed
*/
private function getIndividualValue($value)
@@ -1781,6 +1843,8 @@ class BasicEntityPersister
* Checks whether the given managed entity exists in the database.
*
* @param object $entity
+ * @param array $extraConditions
+ *
* @return boolean TRUE if the entity exists in the database, FALSE otherwise.
*/
public function exists($entity, array $extraConditions = array())
@@ -1814,6 +1878,7 @@ class BasicEntityPersister
* Generates the appropriate join SQL for the given join column.
*
* @param array $joinColumns The join columns definition of an association.
+ *
* @return string LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise.
*/
protected function getJoinSQLForJoinColumns($joinColumns)
@@ -1832,6 +1897,7 @@ class BasicEntityPersister
* Gets an SQL column alias for a column name.
*
* @param string $columnName
+ *
* @return string
*/
public function getSQLColumnAlias($columnName)
@@ -1842,8 +1908,8 @@ class BasicEntityPersister
/**
* Generates the filter SQL for a given entity and table alias.
*
- * @param ClassMetadata $targetEntity Metadata of the target entity.
- * @param string $targetTableAlias The table alias of the joined/selected table.
+ * @param ClassMetadata $targetEntity Metadata of the target entity.
+ * @param string $targetTableAlias The table alias of the joined/selected table.
*
* @return string The SQL query part to add to a query.
*/
diff --git a/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php b/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php
index e30d5fbce..04da1f7df 100644
--- a/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php
+++ b/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php
@@ -26,5 +26,4 @@ namespace Doctrine\ORM\Persisters;
*/
abstract class ElementCollectionPersister extends AbstractCollectionPersister
{
-
}
diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
index 58aa7df17..4027d40f5 100644
--- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
+++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php
@@ -87,7 +87,9 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
* Gets the name of the table that owns the column the given field is mapped to.
*
* @param string $fieldName
+ *
* @return string
+ *
* @override
*/
public function getOwningTable($fieldName)
@@ -408,8 +410,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
return 'FROM ' . $quotedTableName . ' ' . $baseTableAlias . $joinSql;
}
- /*
+ /**
* Ensure this method is never called. This persister overrides getSelectEntitiesSQL directly.
+ *
+ * @return string
*/
protected function getSelectColumnsSQL()
{
@@ -548,5 +552,4 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister
$value = $this->fetchVersionValue($this->getVersionedClassMetadata(), $id);
$this->class->setFieldValue($entity, $this->class->versionField, $value);
}
-
}
diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
index 315888676..c1c3cf6c3 100644
--- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
+++ b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
@@ -61,6 +61,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
* {@inheritdoc}
*
* @override
+ *
* @internal Order of the parameters must be the same as the order of the columns in getDeleteRowSql.
*/
protected function getDeleteRowSQLParameters(PersistentCollection $coll, $element)
@@ -70,7 +71,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
- *
+ *
* @throws \BadMethodCallException Not used for OneToManyPersister
*/
protected function getUpdateRowSQL(PersistentCollection $coll)
@@ -82,6 +83,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
* {@inheritdoc}
*
* @override
+ *
* @internal Order of the parameters must be the same as the order of the columns in getInsertRowSql.
*/
protected function getInsertRowSQL(PersistentCollection $coll)
@@ -107,6 +109,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
* {@inheritdoc}
*
* @override
+ *
* @internal Order of the parameters must be the same as the order of the columns in getInsertRowSql.
*/
protected function getInsertRowSQLParameters(PersistentCollection $coll, $element)
@@ -119,7 +122,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
* of the join table columns as specified in ManyToManyMapping#joinTableColumns.
*
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
+ *
* @return array
*/
private function collectJoinTableColumnParameters(PersistentCollection $coll, $element)
@@ -181,6 +185,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
* {@inheritdoc}
*
* @override
+ *
* @internal Order of the parameters must be the same as the order of the columns in getDeleteSql.
*/
protected function getDeleteSQLParameters(PersistentCollection $coll)
@@ -253,8 +258,9 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param int $offset
- * @param int $length
+ * @param int $offset
+ * @param int|null $length
+ *
* @return array
*/
public function slice(PersistentCollection $coll, $offset, $length = null)
@@ -266,7 +272,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
+ *
* @return boolean
*/
public function contains(PersistentCollection $coll, $element)
@@ -294,7 +301,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
+ *
* @return boolean
*/
public function removeElement(PersistentCollection $coll, $element)
@@ -323,8 +331,9 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
- * @param boolean $addFilters Whether the filter SQL should be included or not.
+ * @param object $element
+ * @param boolean $addFilters Whether the filter SQL should be included or not.
+ *
* @return array
*/
private function getJoinTableRestrictions(PersistentCollection $coll, $element, $addFilters)
@@ -431,8 +440,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
/**
* Generates the filter SQL for a given entity and table alias.
*
- * @param ClassMetadata $targetEntity Metadata of the target entity.
- * @param string $targetTableAlias The table alias of the joined/selected table.
+ * @param ClassMetadata $targetEntity Metadata of the target entity.
+ * @param string $targetTableAlias The table alias of the joined/selected table.
*
* @return string The SQL query part to add to a query.
*/
diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php
index 100e834cf..911d699f6 100644
--- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php
+++ b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php
@@ -37,7 +37,9 @@ class OneToManyPersister extends AbstractCollectionPersister
* key to null.
*
* @param \Doctrine\ORM\PersistentCollection $coll
+ *
* @return string
+ *
* @override
*/
protected function getDeleteRowSQL(PersistentCollection $coll)
@@ -61,7 +63,8 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
- * @throws \BadMethodCallException Not used for OneToManyPersister
+ *
+ * @throws \BadMethodCallException Not used for OneToManyPersister.
*/
protected function getInsertRowSQL(PersistentCollection $coll)
{
@@ -70,8 +73,8 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
- *
- * @throws \BadMethodCallException Not used for OneToManyPersister
+ *
+ * @throws \BadMethodCallException Not used for OneToManyPersister.
*/
protected function getInsertRowSQLParameters(PersistentCollection $coll, $element)
{
@@ -81,7 +84,7 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
*
- * @throws \BadMethodCallException Not used for OneToManyPersister
+ * @throws \BadMethodCallException Not used for OneToManyPersister.
*/
protected function getUpdateRowSQL(PersistentCollection $coll)
{
@@ -91,7 +94,7 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
*
- * @throws \BadMethodCallException Not used for OneToManyPersister
+ * @throws \BadMethodCallException Not used for OneToManyPersister.
*/
protected function getDeleteSQL(PersistentCollection $coll)
{
@@ -101,7 +104,7 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* {@inheritdoc}
*
- * @throws \BadMethodCallException Not used for OneToManyPersister
+ * @throws \BadMethodCallException Not used for OneToManyPersister.
*/
protected function getDeleteSQLParameters(PersistentCollection $coll)
{
@@ -146,8 +149,9 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param int $offset
- * @param int $length
+ * @param int $offset
+ * @param int|null $length
+ *
* @return \Doctrine\Common\Collections\ArrayCollection
*/
public function slice(PersistentCollection $coll, $offset, $length = null)
@@ -161,7 +165,8 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
+ *
* @return boolean
*/
public function contains(PersistentCollection $coll, $element)
@@ -193,7 +198,8 @@ class OneToManyPersister extends AbstractCollectionPersister
/**
* @param \Doctrine\ORM\PersistentCollection $coll
- * @param object $element
+ * @param object $element
+ *
* @return boolean
*/
public function removeElement(PersistentCollection $coll, $element)
diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php
index ed3924fbe..0d7abc8d9 100644
--- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php
+++ b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php
@@ -147,6 +147,9 @@ class SingleTablePersister extends AbstractEntityInheritancePersister
return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL();
}
+ /**
+ * @return string
+ */
protected function getSelectConditionDiscriminatorValueSQL()
{
$values = array();
diff --git a/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php b/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php
index 2fb685f98..4e7cc268d 100644
--- a/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php
+++ b/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php
@@ -46,7 +46,7 @@ class SqlExpressionVisitor extends ExpressionVisitor
}
/**
- * Convert a comparison expression into the target query language output
+ * Converts a comparison expression into the target query language output.
*
* @param \Doctrine\Common\Collections\Expr\Comparison $comparison
*
@@ -61,11 +61,13 @@ class SqlExpressionVisitor extends ExpressionVisitor
}
/**
- * Convert a composite expression into the target query language output
+ * Converts a composite expression into the target query language output.
*
* @param \Doctrine\Common\Collections\Expr\CompositeExpression $expr
*
* @return mixed
+ *
+ * @throws \RuntimeException
*/
public function walkCompositeExpression(CompositeExpression $expr)
{
@@ -88,7 +90,7 @@ class SqlExpressionVisitor extends ExpressionVisitor
}
/**
- * Convert a value expression into the target query language part.
+ * Converts a value expression into the target query language part.
*
* @param \Doctrine\Common\Collections\Expr\Value $value
*
diff --git a/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php b/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php
index 62422cf61..1d805c041 100644
--- a/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php
+++ b/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php
@@ -42,7 +42,7 @@ class SqlValueVisitor extends ExpressionVisitor
private $types = array();
/**
- * Convert a comparison expression into the target query language output
+ * Converts a comparison expression into the target query language output.
*
* @param \Doctrine\Common\Collections\Expr\Comparison $comparison
*
@@ -58,7 +58,7 @@ class SqlValueVisitor extends ExpressionVisitor
}
/**
- * Convert a composite expression into the target query language output
+ * Converts a composite expression into the target query language output.
*
* @param \Doctrine\Common\Collections\Expr\CompositeExpression $expr
*
@@ -72,7 +72,7 @@ class SqlValueVisitor extends ExpressionVisitor
}
/**
- * Convert a value expression into the target query language part.
+ * Converts a value expression into the target query language part.
*
* @param \Doctrine\Common\Collections\Expr\Value $value
*
@@ -84,7 +84,7 @@ class SqlValueVisitor extends ExpressionVisitor
}
/**
- * Return the Parameters and Types necessary for matching the last visited expression.
+ * Returns the Parameters and Types necessary for matching the last visited expression.
*
* @return array
*/
diff --git a/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php b/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php
index b2ea51490..d27dcc9fd 100644
--- a/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php
+++ b/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php
@@ -21,5 +21,4 @@ namespace Doctrine\ORM\Persisters;
class UnionSubclassPersister extends BasicEntityPersister
{
-
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/PessimisticLockException.php b/lib/Doctrine/ORM/PessimisticLockException.php
index 5939e282f..2bc93bffe 100644
--- a/lib/Doctrine/ORM/PessimisticLockException.php
+++ b/lib/Doctrine/ORM/PessimisticLockException.php
@@ -30,6 +30,9 @@ namespace Doctrine\ORM;
*/
class PessimisticLockException extends ORMException
{
+ /**
+ * @return PessimisticLockException
+ */
public static function lockFailed()
{
return new self("The pessimistic lock failed.");
diff --git a/lib/Doctrine/ORM/Proxy/Autoloader.php b/lib/Doctrine/ORM/Proxy/Autoloader.php
index 0b4d9a019..b79719388 100644
--- a/lib/Doctrine/ORM/Proxy/Autoloader.php
+++ b/lib/Doctrine/ORM/Proxy/Autoloader.php
@@ -27,7 +27,7 @@ namespace Doctrine\ORM\Proxy;
class Autoloader
{
/**
- * Resolve proxy class name to a filename based on the following pattern.
+ * Resolves proxy class name to a filename based on the following pattern.
*
* 1. Remove Proxy namespace from class name
* 2. Remove namespace seperators from remaining class name.
@@ -36,7 +36,10 @@ class Autoloader
* @param string $proxyDir
* @param string $proxyNamespace
* @param string $className
+ *
* @return string
+ *
+ * @throws ProxyException
*/
static public function resolveFile($proxyDir, $proxyNamespace, $className)
{
@@ -49,13 +52,14 @@ class Autoloader
}
/**
- * Register and return autoloader callback for the given proxy dir and
+ * Registers and returns autoloader callback for the given proxy dir and
* namespace.
*
- * @param string $proxyDir
- * @param string $proxyNamespace
- * @param Closure $notFoundCallback Invoked when the proxy file is not found.
- * @return Closure
+ * @param string $proxyDir
+ * @param string $proxyNamespace
+ * @param \Closure $notFoundCallback Invoked when the proxy file is not found.
+ *
+ * @return \Closure
*/
static public function register($proxyDir, $proxyNamespace, \Closure $notFoundCallback = null)
{
@@ -75,4 +79,3 @@ class Autoloader
return $autoloader;
}
}
-
diff --git a/lib/Doctrine/ORM/Proxy/Proxy.php b/lib/Doctrine/ORM/Proxy/Proxy.php
index 47cda9027..ed588af6d 100644
--- a/lib/Doctrine/ORM/Proxy/Proxy.php
+++ b/lib/Doctrine/ORM/Proxy/Proxy.php
@@ -27,4 +27,6 @@ use Doctrine\Common\Persistence\Proxy as BaseProxy;
* @author Roman Borschel
* @since 2.0
*/
-interface Proxy extends BaseProxy {}
+interface Proxy extends BaseProxy
+{
+}
diff --git a/lib/Doctrine/ORM/Proxy/ProxyException.php b/lib/Doctrine/ORM/Proxy/ProxyException.php
index 4e26d8662..7f28a20e0 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyException.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyException.php
@@ -20,27 +20,45 @@
namespace Doctrine\ORM\Proxy;
/**
- * ORM Proxy Exception
+ * ORM Proxy Exception.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
* @since 1.0
* @author Benjamin Eberlei
*/
-class ProxyException extends \Doctrine\ORM\ORMException {
-
- public static function proxyDirectoryRequired() {
+class ProxyException extends \Doctrine\ORM\ORMException
+{
+ /**
+ * @return ProxyException
+ */
+ public static function proxyDirectoryRequired()
+ {
return new self("You must configure a proxy directory. See docs for details");
}
- public static function proxyDirectoryNotWritable() {
+ /**
+ * @return ProxyException
+ */
+ public static function proxyDirectoryNotWritable()
+ {
return new self("Your proxy directory must be writable.");
}
- public static function proxyNamespaceRequired() {
+ /**
+ * @return ProxyException
+ */
+ public static function proxyNamespaceRequired()
+ {
return new self("You must configure a proxy namespace. See docs for details");
}
+ /**
+ * @param $className
+ * @param $proxyNamespace
+ *
+ * @return ProxyException
+ */
public static function notProxyClass($className, $proxyNamespace)
{
return new self(sprintf(
@@ -48,5 +66,4 @@ class ProxyException extends \Doctrine\ORM\ORMException {
$className, $proxyNamespace
));
}
-
}
diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
index 7000dae0b..47dd2c28c 100644
--- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php
+++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -32,13 +32,32 @@ use Doctrine\Common\Util\ClassUtils;
*/
class ProxyFactory
{
- /** The EntityManager this factory is bound to. */
+ /**
+ * The EntityManager this factory is bound to.
+ *
+ * @var \Doctrine\ORM\EntityManager
+ */
private $_em;
- /** Whether to automatically (re)generate proxy classes. */
+
+ /**
+ * Whether to automatically (re)generate proxy classes.
+ *
+ * @var bool
+ */
private $_autoGenerate;
- /** The namespace that contains all proxy classes. */
+
+ /**
+ * The namespace that contains all proxy classes.
+ *
+ * @var string
+ */
private $_proxyNamespace;
- /** The directory that contains all proxy classes. */
+
+ /**
+ * The directory that contains all proxy classes.
+ *
+ * @var string
+ */
private $_proxyDir;
/**
@@ -53,10 +72,12 @@ class ProxyFactory
* Initializes a new instance of the ProxyFactory class that is
* connected to the given EntityManager.
*
- * @param EntityManager $em The EntityManager the new factory works for.
- * @param string $proxyDir The directory to use for the proxy classes. It must exist.
- * @param string $proxyNs The namespace to use for the proxy classes.
- * @param boolean $autoGenerate Whether to automatically generate proxy classes.
+ * @param EntityManager $em The EntityManager the new factory works for.
+ * @param string $proxyDir The directory to use for the proxy classes. It must exist.
+ * @param string $proxyNs The namespace to use for the proxy classes.
+ * @param boolean $autoGenerate Whether to automatically generate proxy classes.
+ *
+ * @throws ProxyException
*/
public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = false)
{
@@ -77,7 +98,8 @@ class ProxyFactory
* the given identifier.
*
* @param string $className
- * @param mixed $identifier
+ * @param mixed $identifier
+ *
* @return object
*/
public function getProxy($className, $identifier)
@@ -98,12 +120,12 @@ class ProxyFactory
}
/**
- * Generate the Proxy file name
+ * Generates the Proxy file name.
*
- * @param string $className
- * @param string $baseDir Optional base directory for proxy file name generation.
- * If not specified, the directory configured on the Configuration of the
- * EntityManager will be used by this factory.
+ * @param string $className
+ * @param string|null $baseDir Optional base directory for proxy file name generation.
+ * If not specified, the directory configured on the Configuration of the
+ * EntityManager will be used by this factory.
* @return string
*/
private function getProxyFileName($className, $baseDir = null)
@@ -116,10 +138,11 @@ class ProxyFactory
/**
* Generates proxy classes for all given classes.
*
- * @param array $classes The classes (ClassMetadata instances) for which to generate proxies.
- * @param string $toDir The target directory of the proxy classes. If not specified, the
- * directory configured on the Configuration of the EntityManager used
- * by this factory is used.
+ * @param array $classes The classes (ClassMetadata instances) for which to generate proxies.
+ * @param string|null $toDir The target directory of the proxy classes. If not specified, the
+ * directory configured on the Configuration of the EntityManager used
+ * by this factory is used.
+ *
* @return int Number of generated proxies.
*/
public function generateProxyClasses(array $classes, $toDir = null)
@@ -146,9 +169,13 @@ class ProxyFactory
/**
* Generates a proxy class file.
*
- * @param ClassMetadata $class Metadata for the original class
- * @param string $fileName Filename (full path) for the generated class
- * @param string $file The proxy class template data
+ * @param ClassMetadata $class Metadata for the original class.
+ * @param string $fileName Filename (full path) for the generated class.
+ * @param string $file The proxy class template data.
+ *
+ * @return void
+ *
+ * @throws ProxyException
*/
private function _generateProxyClass(ClassMetadata $class, $fileName, $file)
{
@@ -198,6 +225,7 @@ class ProxyFactory
* Generates the methods of a proxy class.
*
* @param ClassMetadata $class
+ *
* @return string The code of the generated methods.
*/
private function _generateMethods(ClassMetadata $class)
@@ -206,7 +234,7 @@ class ProxyFactory
$methodNames = array();
foreach ($class->reflClass->getMethods() as $method) {
- /* @var $method ReflectionMethod */
+ /* @var $method \ReflectionMethod */
if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone")) || isset($methodNames[$method->getName()])) {
continue;
}
@@ -269,7 +297,7 @@ class ProxyFactory
}
/**
- * Check if the method is a short identifier getter.
+ * Checks if the method is a short identifier getter.
*
* What does this mean? For proxy objects the identifier is already known,
* however accessing the getter for this identifier usually triggers the
@@ -277,8 +305,9 @@ class ProxyFactory
* ID is interesting for the userland code (for example in views that
* generate links to the entity, but do not display anything else).
*
- * @param ReflectionMethod $method
- * @param ClassMetadata $class
+ * @param \ReflectionMethod $method
+ * @param ClassMetadata $class
+ *
* @return bool
*/
private function isShortIdentifierGetter($method, ClassMetadata $class)
@@ -309,7 +338,8 @@ class ProxyFactory
/**
* Generates the code for the __sleep method for a proxy class.
*
- * @param $class
+ * @param ClassMetadata $class
+ *
* @return string
*/
private function _generateSleep(ClassMetadata $class)
diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php
index 2e1b8178b..8b8d40111 100644
--- a/lib/Doctrine/ORM/Query.php
+++ b/lib/Doctrine/ORM/Query.php
@@ -41,6 +41,7 @@ final class Query extends AbstractQuery
* A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts.
*/
const STATE_CLEAN = 1;
+
/**
* A query object is in state DIRTY when it has DQL parts that have not yet been
* parsed/processed. This is automatically defined as DIRTY when addDqlQueryPart
@@ -49,6 +50,7 @@ final class Query extends AbstractQuery
const STATE_DIRTY = 2;
/* Query HINTS */
+
/**
* The refresh hint turns any query into a refresh query with the result that
* any local changes in entities are overridden with the fetched values.
@@ -57,7 +59,6 @@ final class Query extends AbstractQuery
*/
const HINT_REFRESH = 'doctrine.refresh';
-
/**
* Internal hint: is set to the proxy entity that is currently triggered for loading
*
@@ -73,6 +74,7 @@ final class Query extends AbstractQuery
* @todo Rename: HINT_OPTIMIZE
*/
const HINT_FORCE_PARTIAL_LOAD = 'doctrine.forcePartialLoad';
+
/**
* The includeMetaColumns query hint causes meta columns like foreign keys and
* discriminator columns to be selected and returned as part of the query result.
@@ -111,49 +113,66 @@ final class Query extends AbstractQuery
*/
const HINT_LOCK_MODE = 'doctrine.lockMode';
-
/**
- * @var integer $_state The current state of this query.
+ * The current state of this query.
+ *
+ * @var integer
*/
private $_state = self::STATE_CLEAN;
/**
- * @var string $_dql Cached DQL query.
+ * Cached DQL query.
+ *
+ * @var string
*/
private $_dql = null;
/**
- * @var \Doctrine\ORM\Query\ParserResult The parser result that holds DQL => SQL information.
+ * The parser result that holds DQL => SQL information.
+ *
+ * @var \Doctrine\ORM\Query\ParserResult
*/
private $_parserResult;
/**
- * @var integer The first result to return (the "offset").
+ * The first result to return (the "offset").
+ *
+ * @var integer
*/
private $_firstResult = null;
/**
- * @var integer The maximum number of results to return (the "limit").
+ * The maximum number of results to return (the "limit").
+ *
+ * @var integer
*/
private $_maxResults = null;
/**
- * @var CacheDriver The cache driver used for caching queries.
+ * The cache driver used for caching queries.
+ *
+ * @var \Doctrine\Common\Cache\Cache|null
*/
private $_queryCache;
/**
- * @var boolean Boolean value that indicates whether or not expire the query cache.
+ * Whether or not expire the query cache.
+ *
+ * @var boolean
*/
private $_expireQueryCache = false;
/**
- * @var int Query Cache lifetime.
+ * The query cache lifetime.
+ *
+ * @var int
*/
private $_queryCacheTTL;
/**
- * @var boolean Whether to use a query cache, if available. Defaults to TRUE.
+ * Whether to use a query cache, if available. Defaults to TRUE.
+ *
+ * @var boolean
*/
private $_useQueryCache = true;
@@ -171,6 +190,7 @@ final class Query extends AbstractQuery
* Gets the SQL query/queries that correspond to this DQL query.
*
* @return mixed The built sql query or an array of all sql queries.
+ *
* @override
*/
public function getSQL()
@@ -265,10 +285,13 @@ final class Query extends AbstractQuery
}
/**
- * Processes query parameter mappings
+ * Processes query parameter mappings.
*
* @param array $paramMappings
+ *
* @return array
+ *
+ * @throws Query\QueryException
*/
private function processParameterMappings($paramMappings)
{
@@ -321,7 +344,8 @@ final class Query extends AbstractQuery
/**
* Defines a cache driver to be used for caching queries.
*
- * @param Doctrine_Cache_Interface|null $driver Cache driver
+ * @param \Doctrine\Common\Cache\Cache|null $queryCache Cache driver.
+ *
* @return Query This query instance.
*/
public function setQueryCacheDriver($queryCache)
@@ -335,7 +359,8 @@ final class Query extends AbstractQuery
* Defines whether the query should make use of a query cache, if available.
*
* @param boolean $bool
- * @return @return Query This query instance.
+ *
+ * @return Query This query instance.
*/
public function useQueryCache($bool)
{
@@ -347,8 +372,8 @@ final class Query extends AbstractQuery
/**
* Returns the cache driver used for query caching.
*
- * @return CacheDriver The cache driver used for query caching or NULL, if
- * this Query does not use query caching.
+ * @return \Doctrine\Common\Cache\Cache|null The cache driver used for query caching or NULL, if
+ * this Query does not use query caching.
*/
public function getQueryCacheDriver()
{
@@ -362,7 +387,8 @@ final class Query extends AbstractQuery
/**
* Defines how long the query cache will be active before expire.
*
- * @param integer $timeToLive How long the cache entry is valid
+ * @param integer $timeToLive How long the cache entry is valid.
+ *
* @return Query This query instance.
*/
public function setQueryCacheLifetime($timeToLive)
@@ -390,6 +416,7 @@ final class Query extends AbstractQuery
* Defines if the query cache is active or not.
*
* @param boolean $expire Whether or not to force query cache expiration.
+ *
* @return Query This query instance.
*/
public function expireQueryCache($expire = true)
@@ -423,7 +450,8 @@ final class Query extends AbstractQuery
/**
* Sets a DQL query string.
*
- * @param string $dqlQuery DQL Query
+ * @param string $dqlQuery DQL Query.
+ *
* @return \Doctrine\ORM\AbstractQuery
*/
public function setDQL($dqlQuery)
@@ -439,7 +467,7 @@ final class Query extends AbstractQuery
/**
* Returns the DQL query that is represented by this query object.
*
- * @return string DQL query
+ * @return string DQL query.
*/
public function getDQL()
{
@@ -454,7 +482,7 @@ final class Query extends AbstractQuery
* @see AbstractQuery::STATE_CLEAN
* @see AbstractQuery::STATE_DIRTY
*
- * @return integer Return the query state
+ * @return integer The query state.
*/
public function getState()
{
@@ -464,7 +492,8 @@ final class Query extends AbstractQuery
/**
* Method to check if an arbitrary piece of DQL exists
*
- * @param string $dql Arbitrary piece of DQL to check for
+ * @param string $dql Arbitrary piece of DQL to check for.
+ *
* @return boolean
*/
public function contains($dql)
@@ -476,6 +505,7 @@ final class Query extends AbstractQuery
* Sets the position of the first result to retrieve (the "offset").
*
* @param integer $firstResult The first result to return.
+ *
* @return Query This query object.
*/
public function setFirstResult($firstResult)
@@ -501,6 +531,7 @@ final class Query extends AbstractQuery
* Sets the maximum number of results to retrieve (the "limit").
*
* @param integer $maxResults
+ *
* @return Query This query object.
*/
public function setMaxResults($maxResults)
@@ -526,8 +557,9 @@ final class Query extends AbstractQuery
* Executes the query and returns an IterableResult that can be used to incrementally
* iterated over the result.
*
- * @param \Doctrine\Common\Collections\ArrayCollection|array $parameters The query parameters.
- * @param integer $hydrationMode The hydration mode to use.
+ * @param ArrayCollection|array|null $parameters The query parameters.
+ * @param integer $hydrationMode The hydration mode to use.
+ *
* @return \Doctrine\ORM\Internal\Hydration\IterableResult
*/
public function iterate($parameters = null, $hydrationMode = self::HYDRATE_OBJECT)
@@ -561,8 +593,12 @@ final class Query extends AbstractQuery
* Set the lock mode for this Query.
*
* @see \Doctrine\DBAL\LockMode
+ *
* @param int $lockMode
+ *
* @return Query
+ *
+ * @throws TransactionRequiredException
*/
public function setLockMode($lockMode)
{
diff --git a/lib/Doctrine/ORM/Query/AST/ASTException.php b/lib/Doctrine/ORM/Query/AST/ASTException.php
index 4633322a1..b8f931b45 100644
--- a/lib/Doctrine/ORM/Query/AST/ASTException.php
+++ b/lib/Doctrine/ORM/Query/AST/ASTException.php
@@ -26,8 +26,13 @@ use Doctrine\ORM\Query\QueryException;
*/
class ASTException extends QueryException
{
+ /**
+ * @param Node $node
+ *
+ * @return ASTException
+ */
public static function noDispatchForNode($node)
{
return new self("Double-dispatch for node " . get_class($node) . " is not supported.");
}
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Query/AST/AggregateExpression.php b/lib/Doctrine/ORM/Query/AST/AggregateExpression.php
index ec91ada24..0966d902b 100644
--- a/lib/Doctrine/ORM/Query/AST/AggregateExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/AggregateExpression.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Description of AggregateExpression
+ * Description of AggregateExpression.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,10 +30,28 @@ namespace Doctrine\ORM\Query\AST;
*/
class AggregateExpression extends Node
{
+ /**
+ * @var string
+ */
public $functionName;
- public $pathExpression;
- public $isDistinct = false; // Some aggregate expressions support distinct, eg COUNT
+ /**
+ * @var PathExpression|SimpleArithmeticExpression
+ */
+ public $pathExpression;
+
+ /**
+ * Some aggregate expressions support distinct, eg COUNT.
+ *
+ * @var bool
+ */
+ public $isDistinct = false;
+
+ /**
+ * @param string $functionName
+ * @param PathExpression|SimpleArithmeticExpression $pathExpression
+ * @param bool $isDistinct
+ */
public function __construct($functionName, $pathExpression, $isDistinct)
{
$this->functionName = $functionName;
@@ -42,6 +59,9 @@ class AggregateExpression extends Node
$this->isDistinct = $isDistinct;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkAggregateExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php b/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
index 55a6b0602..b586cba30 100644
--- a/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,19 +30,35 @@ namespace Doctrine\ORM\Query\AST;
*/
class ArithmeticExpression extends Node
{
+ /**
+ * @var SimpleArithmeticExpression|null
+ */
public $simpleArithmeticExpression;
+
+ /**
+ * @var Subselect|null
+ */
public $subselect;
+ /**
+ * @return bool
+ */
public function isSimpleArithmeticExpression()
{
return (bool) $this->simpleArithmeticExpression;
}
+ /**
+ * @return bool
+ */
public function isSubselect()
{
return (bool) $this->subselect;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkArithmeticExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php b/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
index 8d595efc4..3120466fd 100644
--- a/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
+++ b/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -32,31 +31,46 @@ namespace Doctrine\ORM\Query\AST;
class ArithmeticFactor extends Node
{
/**
- * @var ArithmeticPrimary
+ * @var mixed
*/
public $arithmeticPrimary;
/**
- * @var null|boolean NULL represents no sign, TRUE means positive and FALSE means negative sign
+ * NULL represents no sign, TRUE means positive and FALSE means negative sign.
+ *
+ * @var null|boolean
*/
public $sign;
+ /**
+ * @param mixed $arithmeticPrimary
+ * @param null|bool $sign
+ */
public function __construct($arithmeticPrimary, $sign = null)
{
$this->arithmeticPrimary = $arithmeticPrimary;
$this->sign = $sign;
}
+ /**
+ * @return bool
+ */
public function isPositiveSigned()
{
return $this->sign === true;
}
+ /**
+ * @return bool
+ */
public function isNegativeSigned()
{
return $this->sign === false;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkArithmeticFactor($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php b/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
index ced25e99f..e08ae7fbb 100644
--- a/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
+++ b/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class ArithmeticTerm extends Node
{
+ /**
+ * @var array
+ */
public $arithmeticFactors;
+ /**
+ * @param array $arithmeticFactors
+ */
public function __construct(array $arithmeticFactors)
{
$this->arithmeticFactors = $arithmeticFactors;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkArithmeticTerm($this);
diff --git a/lib/Doctrine/ORM/Query/AST/BetweenExpression.php b/lib/Doctrine/ORM/Query/AST/BetweenExpression.php
index 83ba6cafd..1e31fd1a5 100644
--- a/lib/Doctrine/ORM/Query/AST/BetweenExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/BetweenExpression.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Description of BetweenExpression
+ * Description of BetweenExpression.
*
-
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,11 +30,31 @@ namespace Doctrine\ORM\Query\AST;
*/
class BetweenExpression extends Node
{
+ /**
+ * @var ArithmeticExpression
+ */
public $expression;
+
+ /**
+ * @var ArithmeticExpression
+ */
public $leftBetweenExpression;
+
+ /**
+ * @var ArithmeticExpression
+ */
public $rightBetweenExpression;
+
+ /**
+ * @var bool
+ */
public $not;
+ /**
+ * @param ArithmeticExpression $expr
+ * @param ArithmeticExpression $leftExpr
+ * @param ArithmeticExpression $rightExpr
+ */
public function __construct($expr, $leftExpr, $rightExpr)
{
$this->expression = $expr;
@@ -43,9 +62,11 @@ class BetweenExpression extends Node
$this->rightBetweenExpression = $rightExpr;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkBetweenExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php b/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php
index 731d45eb8..194f9ace5 100644
--- a/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php
@@ -32,14 +32,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class CoalesceExpression extends Node
{
+ /**
+ * @var array
+ */
public $scalarExpressions = array();
-
+ /**
+ * @param array $scalarExpressions
+ */
public function __construct(array $scalarExpressions)
{
$this->scalarExpressions = $scalarExpressions;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkCoalesceExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php b/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
index b8c7b53a0..70989a267 100644
--- a/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
@@ -32,18 +32,32 @@ namespace Doctrine\ORM\Query\AST;
class CollectionMemberExpression extends Node
{
public $entityExpression;
+
+ /**
+ * @var PathExpression
+ */
public $collectionValuedPathExpression;
+
+ /**
+ * @var bool
+ */
public $not;
+ /**
+ * @param mixed $entityExpr
+ * @param PathExpression $collValuedPathExpr
+ */
public function __construct($entityExpr, $collValuedPathExpr)
{
$this->entityExpression = $entityExpr;
$this->collectionValuedPathExpression = $collValuedPathExpr;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkCollectionMemberExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php b/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
index d3105a1f3..05583920d 100644
--- a/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
@@ -27,7 +27,6 @@ namespace Doctrine\ORM\Query\AST;
* DatetimeExpression ComparisonOperator (DatetimeExpression | QuantifiedExpression) |
* EntityExpression ("=" | "<>") (EntityExpression | QuantifiedExpression)
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -36,10 +35,26 @@ namespace Doctrine\ORM\Query\AST;
*/
class ComparisonExpression extends Node
{
+ /**
+ * @var Node
+ */
public $leftExpression;
+
+ /**
+ * @var Node
+ */
public $rightExpression;
+
+ /**
+ * @var string
+ */
public $operator;
+ /**
+ * @param Node $leftExpr
+ * @param string $operator
+ * @param Node $rightExpr
+ */
public function __construct($leftExpr, $operator, $rightExpr)
{
$this->leftExpression = $leftExpr;
@@ -47,6 +62,9 @@ class ComparisonExpression extends Node
$this->operator = $operator;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkComparisonExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php b/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php
index c302aa204..62c7b2bca 100644
--- a/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class ConditionalExpression extends Node
{
+ /**
+ * @var array
+ */
public $conditionalTerms = array();
+ /**
+ * @param array $conditionalTerms
+ */
public function __construct(array $conditionalTerms)
{
$this->conditionalTerms = $conditionalTerms;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkConditionalExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php b/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
index b17089b78..7c89faa42 100644
--- a/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
+++ b/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalFactor ::= ["NOT"] ConditionalPrimary
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,14 +30,27 @@ namespace Doctrine\ORM\Query\AST;
*/
class ConditionalFactor extends Node
{
+ /**
+ * @var bool
+ */
public $not = false;
+
+ /**
+ * @var ConditionalPrimary
+ */
public $conditionalPrimary;
+ /**
+ * @param ConditionalPrimary $conditionalPrimary
+ */
public function __construct($conditionalPrimary)
{
$this->conditionalPrimary = $conditionalPrimary;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkConditionalFactor($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php b/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
index 8a7c0b7c6..1eed41dce 100644
--- a/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
+++ b/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,19 +30,35 @@ namespace Doctrine\ORM\Query\AST;
*/
class ConditionalPrimary extends Node
{
+ /**
+ * @var Node|null
+ */
public $simpleConditionalExpression;
+
+ /**
+ * @var ConditionalExpression|null
+ */
public $conditionalExpression;
+ /**
+ * @return bool
+ */
public function isSimpleConditionalExpression()
{
return (bool) $this->simpleConditionalExpression;
}
+ /**
+ * @return bool
+ */
public function isConditionalExpression()
{
return (bool) $this->conditionalExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkConditionalPrimary($this);
diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php b/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
index d24defc1a..bb92db119 100644
--- a/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
+++ b/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
@@ -21,7 +21,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -30,13 +29,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class ConditionalTerm extends Node
{
+ /**
+ * @var array
+ */
public $conditionalFactors = array();
+ /**
+ * @param array $conditionalFactors
+ */
public function __construct(array $conditionalFactors)
{
$this->conditionalFactors = $conditionalFactors;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkConditionalTerm($this);
diff --git a/lib/Doctrine/ORM/Query/AST/DeleteClause.php b/lib/Doctrine/ORM/Query/AST/DeleteClause.php
index a05e52f06..8ca35c677 100644
--- a/lib/Doctrine/ORM/Query/AST/DeleteClause.php
+++ b/lib/Doctrine/ORM/Query/AST/DeleteClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,17 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class DeleteClause extends Node
{
+ /**
+ * @var string
+ */
public $abstractSchemaName;
+
+ /**
+ * @var string
+ */
public $aliasIdentificationVariable;
+ /**
+ * @param string $abstractSchemaName
+ */
public function __construct($abstractSchemaName)
{
$this->abstractSchemaName = $abstractSchemaName;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkDeleteClause($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/DeleteStatement.php b/lib/Doctrine/ORM/Query/AST/DeleteStatement.php
index f6e8cb31c..da6859b86 100644
--- a/lib/Doctrine/ORM/Query/AST/DeleteStatement.php
+++ b/lib/Doctrine/ORM/Query/AST/DeleteStatement.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* DeleteStatement = DeleteClause [WhereClause]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,14 +30,27 @@ namespace Doctrine\ORM\Query\AST;
*/
class DeleteStatement extends Node
{
+ /**
+ * @var DeleteClause
+ */
public $deleteClause;
+
+ /**
+ * @var WhereClause|null
+ */
public $whereClause;
+ /**
+ * @param DeleteClause $deleteClause
+ */
public function __construct($deleteClause)
{
$this->deleteClause = $deleteClause;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkDeleteStatement($this);
diff --git a/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php b/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
index fbe504c5d..bd978af04 100644
--- a/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,17 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class EmptyCollectionComparisonExpression extends Node
{
+ /**
+ * @var PathExpression
+ */
public $expression;
+
+ /**
+ * @var bool
+ */
public $not;
+ /**
+ * @param PathExpression $expression
+ */
public function __construct($expression)
{
$this->expression = $expression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkEmptyCollectionComparisonExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/ExistsExpression.php b/lib/Doctrine/ORM/Query/AST/ExistsExpression.php
index 94ee55d13..c53a10775 100644
--- a/lib/Doctrine/ORM/Query/AST/ExistsExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/ExistsExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,17 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class ExistsExpression extends Node
{
+ /**
+ * @var bool
+ */
public $not;
+
+ /**
+ * @var Subselect
+ */
public $subselect;
+ /**
+ * @param Subselect $subselect
+ */
public function __construct($subselect)
{
$this->subselect = $subselect;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkExistsExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/FromClause.php b/lib/Doctrine/ORM/Query/AST/FromClause.php
index 32c7a7380..b1d8dfe6b 100644
--- a/lib/Doctrine/ORM/Query/AST/FromClause.php
+++ b/lib/Doctrine/ORM/Query/AST/FromClause.php
@@ -31,13 +31,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class FromClause extends Node
{
+ /**
+ * @var array
+ */
public $identificationVariableDeclarations = array();
+ /**
+ * @param array $identificationVariableDeclarations
+ */
public function __construct(array $identificationVariableDeclarations)
{
$this->identificationVariableDeclarations = $identificationVariableDeclarations;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkFromClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
index d771f050e..8fade4c7a 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
@@ -34,6 +34,9 @@ use Doctrine\ORM\Query\Lexer;
*/
class AbsFunction extends FunctionNode
{
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
+ */
public $simpleArithmeticExpression;
/**
@@ -59,4 +62,3 @@ class AbsFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
index bf5678568..1c3817fe2 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php
@@ -39,6 +39,9 @@ class DateAddFunction extends FunctionNode
public $intervalExpression = null;
public $unit = null;
+ /**
+ * @override
+ */
public function getSql(SqlWalker $sqlWalker)
{
switch (strtolower($this->unit->value)) {
@@ -61,6 +64,9 @@ class DateAddFunction extends FunctionNode
}
}
+ /**
+ * @override
+ */
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php
index f21b9a09f..a33c2d06f 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php
@@ -36,6 +36,9 @@ class DateDiffFunction extends FunctionNode
public $date1;
public $date2;
+ /**
+ * @override
+ */
public function getSql(SqlWalker $sqlWalker)
{
return $sqlWalker->getConnection()->getDatabasePlatform()->getDateDiffExpression(
@@ -44,6 +47,9 @@ class DateDiffFunction extends FunctionNode
);
}
+ /**
+ * @override
+ */
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
index 0cc073096..35add0ed6 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php
@@ -33,6 +33,9 @@ use Doctrine\ORM\Query\QueryException;
*/
class DateSubFunction extends DateAddFunction
{
+ /**
+ * @override
+ */
public function getSql(SqlWalker $sqlWalker)
{
switch (strtolower($this->unit->value)) {
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php b/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php
index bd8b60768..6e9b95afc 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php
@@ -34,19 +34,40 @@ use Doctrine\ORM\Query\AST\Node;
*/
abstract class FunctionNode extends Node
{
+ /**
+ * @var string
+ */
public $name;
+ /**
+ * @param string $name
+ */
public function __construct($name)
{
$this->name = $name;
}
+ /**
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
+ *
+ * @return string
+ */
abstract public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker);
+ /**
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
+ *
+ * @return string
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkFunction($this);
}
+ /**
+ * @param \Doctrine\ORM\Query\Parser $parser
+ *
+ * @return void
+ */
abstract public function parse(\Doctrine\ORM\Query\Parser $parser);
}
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php
index 091942da6..878960bd8 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php
@@ -64,4 +64,3 @@ class IdentityFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
index 9c6f77000..deb3066e2 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
@@ -59,4 +59,3 @@ class LengthFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
index a18908250..cba45bc1c 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
@@ -36,6 +36,10 @@ class LocateFunction extends FunctionNode
{
public $firstStringPrimary;
public $secondStringPrimary;
+
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression|bool
+ */
public $simpleArithmeticExpression = false;
/**
@@ -78,4 +82,3 @@ class LocateFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
index 12c6745e1..ffc86b6f8 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
@@ -59,4 +59,3 @@ class LowerFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
index 27d252e27..cf4cf0c98 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
@@ -34,7 +34,14 @@ use Doctrine\ORM\Query\Lexer;
*/
class ModFunction extends FunctionNode
{
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
+ */
public $firstSimpleArithmeticExpression;
+
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
+ */
public $secondSimpleArithmeticExpression;
/**
@@ -65,4 +72,3 @@ class ModFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
index bffff29f1..7970508f1 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
@@ -34,6 +34,9 @@ use Doctrine\ORM\Query\Lexer;
*/
class SizeFunction extends FunctionNode
{
+ /**
+ * @var \Doctrine\ORM\Query\AST\PathExpression
+ */
public $collectionPathExpression;
/**
@@ -118,4 +121,3 @@ class SizeFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
index cf8c27b4f..c9f1038c4 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
@@ -34,6 +34,9 @@ use Doctrine\ORM\Query\Lexer;
*/
class SqrtFunction extends FunctionNode
{
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
+ */
public $simpleArithmeticExpression;
/**
@@ -59,4 +62,3 @@ class SqrtFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
index 6f3dfbef8..ee80c06ac 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
@@ -35,7 +35,15 @@ use Doctrine\ORM\Query\Lexer;
class SubstringFunction extends FunctionNode
{
public $stringPrimary;
+
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
+ */
public $firstSimpleArithmeticExpression;
+
+ /**
+ * @var \Doctrine\ORM\Query\AST\SimpleArithmeticExpression|null
+ */
public $secondSimpleArithmeticExpression = null;
/**
@@ -79,4 +87,3 @@ class SubstringFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
index 0c60ab01e..69a45d2ee 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
@@ -35,10 +35,26 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
*/
class TrimFunction extends FunctionNode
{
+ /**
+ * @var bool
+ */
public $leading;
+
+ /**
+ * @var bool
+ */
public $trailing;
+
+ /**
+ * @var bool
+ */
public $both;
+
+ /**
+ * @var bool
+ */
public $trimChar = false;
+
public $stringPrimary;
/**
@@ -96,5 +112,4 @@ class TrimFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
-
}
diff --git a/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
index 26c8f0d99..888009a7b 100644
--- a/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
+++ b/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
@@ -59,4 +59,3 @@ class UpperFunction extends FunctionNode
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php b/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php
index ee4b41831..a74eed599 100644
--- a/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php
@@ -32,15 +32,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class GeneralCaseExpression extends Node
{
+ /**
+ * @var array
+ */
public $whenClauses = array();
+
+ /**
+ * @var mixed
+ */
public $elseScalarExpression = null;
+ /**
+ * @param array $whenClauses
+ * @param mixed $elseScalarExpression
+ */
public function __construct(array $whenClauses, $elseScalarExpression)
{
$this->whenClauses = $whenClauses;
$this->elseScalarExpression = $elseScalarExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkGeneralCaseExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/GroupByClause.php b/lib/Doctrine/ORM/Query/AST/GroupByClause.php
index 06350f02d..c05fa5863 100644
--- a/lib/Doctrine/ORM/Query/AST/GroupByClause.php
+++ b/lib/Doctrine/ORM/Query/AST/GroupByClause.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Description of GroupByClause
+ * Description of GroupByClause.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class GroupByClause extends Node
{
+ /**
+ * @var array
+ */
public $groupByItems = array();
+ /**
+ * @param array $groupByItems
+ */
public function __construct(array $groupByItems)
{
$this->groupByItems = $groupByItems;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkGroupByClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/HavingClause.php b/lib/Doctrine/ORM/Query/AST/HavingClause.php
index 971e919bc..1d369fff6 100644
--- a/lib/Doctrine/ORM/Query/AST/HavingClause.php
+++ b/lib/Doctrine/ORM/Query/AST/HavingClause.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Description of HavingClause
+ * Description of HavingClause.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class HavingClause extends Node
{
+ /**
+ * @var ConditionalExpression
+ */
public $conditionalExpression;
+ /**
+ * @param ConditionalExpression $conditionalExpression
+ */
public function __construct($conditionalExpression)
{
$this->conditionalExpression = $conditionalExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkHavingClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php b/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php
index 6bbdaaad6..a8f7f6d35 100644
--- a/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php
+++ b/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,10 +30,26 @@ namespace Doctrine\ORM\Query\AST;
*/
class IdentificationVariableDeclaration extends Node
{
+ /**
+ * @var RangeVariableDeclaration|null
+ */
public $rangeVariableDeclaration = null;
- public $indexBy = null;
- public $joins = array();
+ /**
+ * @var IndexBy|null
+ */
+ public $indexBy = null;
+
+ /**
+ * @var array
+ */
+ public $joins = array();
+
+ /**
+ * @param RangeVariableDeclaration|null $rangeVariableDecl
+ * @param IndexBy|null $indexBy
+ * @param array $joins
+ */
public function __construct($rangeVariableDecl, $indexBy, array $joins)
{
$this->rangeVariableDeclaration = $rangeVariableDecl;
@@ -42,6 +57,9 @@ class IdentificationVariableDeclaration extends Node
$this->joins = $joins;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkIdentificationVariableDeclaration($this);
diff --git a/lib/Doctrine/ORM/Query/AST/InExpression.php b/lib/Doctrine/ORM/Query/AST/InExpression.php
index 39501a406..9d0a8b54e 100644
--- a/lib/Doctrine/ORM/Query/AST/InExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/InExpression.php
@@ -21,7 +21,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -30,19 +29,39 @@ namespace Doctrine\ORM\Query\AST;
*/
class InExpression extends Node
{
+ /**
+ * @var bool
+ */
public $not;
+
+ /**
+ * @var ArithmeticExpression
+ */
public $expression;
+
+ /**
+ * @var array
+ */
public $literals = array();
+
+ /**
+ * @var Subselect|null
+ */
public $subselect;
+ /**
+ * @param ArithmeticExpression $expression
+ */
public function __construct($expression)
{
$this->expression = $expression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkInExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/IndexBy.php b/lib/Doctrine/ORM/Query/AST/IndexBy.php
index 08e9e6a04..c7874b70a 100644
--- a/lib/Doctrine/ORM/Query/AST/IndexBy.php
+++ b/lib/Doctrine/ORM/Query/AST/IndexBy.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class IndexBy extends Node
{
+ /**
+ * @var PathExpression
+ */
public $simpleStateFieldPathExpression = null;
+ /**
+ * @param PathExpression $simpleStateFieldPathExpression
+ */
public function __construct($simpleStateFieldPathExpression)
{
$this->simpleStateFieldPathExpression = $simpleStateFieldPathExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkIndexBy($this);
diff --git a/lib/Doctrine/ORM/Query/AST/InputParameter.php b/lib/Doctrine/ORM/Query/AST/InputParameter.php
index d575df718..cf50140be 100644
--- a/lib/Doctrine/ORM/Query/AST/InputParameter.php
+++ b/lib/Doctrine/ORM/Query/AST/InputParameter.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Description of InputParameter
+ * Description of InputParameter.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,11 +30,20 @@ namespace Doctrine\ORM\Query\AST;
*/
class InputParameter extends Node
{
+ /**
+ * @var bool
+ */
public $isNamed;
+
+ /**
+ * @var string
+ */
public $name;
/**
* @param string $value
+ *
+ * @throws \Doctrine\ORM\Query\QueryException
*/
public function __construct($value)
{
@@ -48,6 +56,9 @@ class InputParameter extends Node
$this->name = $param;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkInputParameter($this);
diff --git a/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php b/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php
index c022cd686..c1fd65b8e 100644
--- a/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php
@@ -23,7 +23,6 @@ namespace Doctrine\ORM\Query\AST;
* InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")")
* InstanceOfParameter ::= AbstractSchemaName | InputParameter
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -32,18 +31,34 @@ namespace Doctrine\ORM\Query\AST;
*/
class InstanceOfExpression extends Node
{
+ /**
+ * @var bool
+ */
public $not;
+
+ /**
+ * @var string
+ */
public $identificationVariable;
+
+ /**
+ * @var array
+ */
public $value;
+ /**
+ * @param string $identVariable
+ */
public function __construct($identVariable)
{
$this->identificationVariable = $identVariable;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkInstanceOfExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/Join.php b/lib/Doctrine/ORM/Query/AST/Join.php
index 6724f9e1d..5c203aa0b 100644
--- a/lib/Doctrine/ORM/Query/AST/Join.php
+++ b/lib/Doctrine/ORM/Query/AST/Join.php
@@ -35,16 +35,34 @@ class Join extends Node
const JOIN_TYPE_LEFTOUTER = 2;
const JOIN_TYPE_INNER = 3;
+ /**
+ * @var int
+ */
public $joinType = self::JOIN_TYPE_INNER;
+
+ /**
+ * @var Node|null
+ */
public $joinAssociationDeclaration = null;
+
+ /**
+ * @var ConditionalExpression|null
+ */
public $conditionalExpression = null;
+ /**
+ * @param int $joinType
+ * @param Node $joinAssociationDeclaration
+ */
public function __construct($joinType, $joinAssociationDeclaration)
{
$this->joinType = $joinType;
$this->joinAssociationDeclaration = $joinAssociationDeclaration;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkJoin($this);
diff --git a/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php b/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php
index 8e97353ea..a33900a6d 100644
--- a/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php
+++ b/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php
@@ -28,10 +28,26 @@ namespace Doctrine\ORM\Query\AST;
*/
class JoinAssociationDeclaration extends Node
{
+ /**
+ * @var JoinAssociationPathExpression
+ */
public $joinAssociationPathExpression;
+
+ /**
+ * @var string
+ */
public $aliasIdentificationVariable;
+
+ /**
+ * @var IndexBy|null
+ */
public $indexBy;
+ /**
+ * @param JoinAssociationPathExpression $joinAssociationPathExpression
+ * @param string $aliasIdentificationVariable
+ * @param IndexBy|null $indexBy
+ */
public function __construct($joinAssociationPathExpression, $aliasIdentificationVariable, $indexBy)
{
$this->joinAssociationPathExpression = $joinAssociationPathExpression;
@@ -39,6 +55,9 @@ class JoinAssociationDeclaration extends Node
$this->indexBy = $indexBy;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkJoinAssociationDeclaration($this);
diff --git a/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php b/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
index 57bd05277..946bbb15b 100644
--- a/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
@@ -30,15 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class JoinAssociationPathExpression extends Node
{
+ /**
+ * @var string
+ */
public $identificationVariable;
+
+ /**
+ * @var string
+ */
public $associationField;
+ /**
+ * @param string $identificationVariable
+ * @param string $associationField
+ */
public function __construct($identificationVariable, $associationField)
{
$this->identificationVariable = $identificationVariable;
$this->associationField = $associationField;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkPathExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php b/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php
index a6bafea21..1c67cb9c4 100644
--- a/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php
@@ -29,15 +29,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class JoinClassPathExpression extends Node
{
+ /**
+ * @var mixed
+ */
public $abstractSchemaName;
+
+ /**
+ * @var mixed
+ */
public $aliasIdentificationVariable;
+ /**
+ * @param mixed $abstractSchemaName
+ * @param mixed $aliasIdentificationVar
+ */
public function __construct($abstractSchemaName, $aliasIdentificationVar)
{
$this->abstractSchemaName = $abstractSchemaName;
$this->aliasIdentificationVariable = $aliasIdentificationVar;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkJoinPathExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/LikeExpression.php b/lib/Doctrine/ORM/Query/AST/LikeExpression.php
index 68f8635b0..e320c51c8 100644
--- a/lib/Doctrine/ORM/Query/AST/LikeExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/LikeExpression.php
@@ -21,7 +21,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* LikeExpression ::= StringExpression ["NOT"] "LIKE" string ["ESCAPE" char]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -30,11 +29,31 @@ namespace Doctrine\ORM\Query\AST;
*/
class LikeExpression extends Node
{
+ /**
+ * @var bool
+ */
public $not;
+
+ /**
+ * @var Node
+ */
public $stringExpression;
+
+ /**
+ * @var InputParameter
+ */
public $stringPattern;
+
+ /**
+ * @var Literal|null
+ */
public $escapeChar;
+ /**
+ * @param Node $stringExpression
+ * @param InputParameter $stringPattern
+ * @param Literal|null $escapeChar
+ */
public function __construct($stringExpression, $stringPattern, $escapeChar = null)
{
$this->stringExpression = $stringExpression;
@@ -42,6 +61,9 @@ class LikeExpression extends Node
$this->escapeChar = $escapeChar;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkLikeExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/Literal.php b/lib/Doctrine/ORM/Query/AST/Literal.php
index 26337cbda..43d71add0 100644
--- a/lib/Doctrine/ORM/Query/AST/Literal.php
+++ b/lib/Doctrine/ORM/Query/AST/Literal.php
@@ -25,17 +25,31 @@ class Literal extends Node
const BOOLEAN = 2;
const NUMERIC = 3;
+ /**
+ * @var int
+ */
public $type;
+
+ /**
+ * @var mixed
+ */
public $value;
+ /**
+ * @param int $type
+ * @param mixed $value
+ */
public function __construct($type, $value)
{
$this->type = $type;
$this->value = $value;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkLiteral($this);
}
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php b/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php
index caf7a80b7..2603cf81b 100644
--- a/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php
@@ -40,8 +40,8 @@ class NewObjectExpression extends Node
public $args;
/**
- * @param type $className
- * @param array $args
+ * @param string $className
+ * @param array $args
*/
public function __construct($className, array $args)
{
@@ -50,11 +50,10 @@ class NewObjectExpression extends Node
}
/**
- * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
- * @return string
+ * {@inheritdoc}
*/
public function dispatch($sqlWalker)
{
return $sqlWalker->walkNewObject($this);
}
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Query/AST/Node.php b/lib/Doctrine/ORM/Query/AST/Node.php
index 25347e577..a257dc2d7 100644
--- a/lib/Doctrine/ORM/Query/AST/Node.php
+++ b/lib/Doctrine/ORM/Query/AST/Node.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\AST;
/**
- * Abstract class of an AST node
+ * Abstract class of an AST node.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -36,7 +35,7 @@ abstract class Node
*
* Implementation is not mandatory for all nodes.
*
- * @param $walker
+ * @param \Doctrine\ORM\Query\SqlWalker $walker
*
* @return string
*
@@ -48,7 +47,7 @@ abstract class Node
}
/**
- * Dumps the AST Node into a string representation for information purpose only
+ * Dumps the AST Node into a string representation for information purpose only.
*
* @return string
*/
@@ -57,6 +56,11 @@ abstract class Node
return $this->dump($this);
}
+ /**
+ * @param object $obj
+ *
+ * @return string
+ */
public function dump($obj)
{
static $ident = 0;
diff --git a/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php b/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
index d0fb8bfd9..84a199784 100644
--- a/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,17 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class NullComparisonExpression extends Node
{
+ /**
+ * @var bool
+ */
public $not;
+
+ /**
+ * @var Node
+ */
public $expression;
+ /**
+ * @param Node $expression
+ */
public function __construct($expression)
{
$this->expression = $expression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkNullComparisonExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/NullIfExpression.php b/lib/Doctrine/ORM/Query/AST/NullIfExpression.php
index 2c85ddd90..e33bc72b1 100644
--- a/lib/Doctrine/ORM/Query/AST/NullIfExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/NullIfExpression.php
@@ -32,16 +32,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class NullIfExpression extends Node
{
+ /**
+ * @var mixed
+ */
public $firstExpression;
+ /**
+ * @var mixed
+ */
public $secondExpression;
+ /**
+ * @param mixed $firstExpression
+ * @param mixed $secondExpression
+ */
public function __construct($firstExpression, $secondExpression)
{
$this->firstExpression = $firstExpression;
$this->secondExpression = $secondExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkNullIfExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/OrderByClause.php b/lib/Doctrine/ORM/Query/AST/OrderByClause.php
index 311a9edce..75d16c731 100644
--- a/lib/Doctrine/ORM/Query/AST/OrderByClause.php
+++ b/lib/Doctrine/ORM/Query/AST/OrderByClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class OrderByClause extends Node
{
+ /**
+ * @var array
+ */
public $orderByItems = array();
+ /**
+ * @param array $orderByItems
+ */
public function __construct(array $orderByItems)
{
$this->orderByItems = $orderByItems;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkOrderByClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/OrderByItem.php b/lib/Doctrine/ORM/Query/AST/OrderByItem.php
index 5d48077ed..bf3288a7b 100644
--- a/lib/Doctrine/ORM/Query/AST/OrderByItem.php
+++ b/lib/Doctrine/ORM/Query/AST/OrderByItem.php
@@ -31,24 +31,43 @@ namespace Doctrine\ORM\Query\AST;
*/
class OrderByItem extends Node
{
+ /**
+ * @var mixed
+ */
public $expression;
+
+ /**
+ * @var string
+ */
public $type;
+ /**
+ * @param mixed $expression
+ */
public function __construct($expression)
{
$this->expression = $expression;
}
+ /**
+ * @return bool
+ */
public function isAsc()
{
return strtoupper($this->type) == 'ASC';
}
+ /**
+ * @return bool
+ */
public function isDesc()
{
return strtoupper($this->type) == 'DESC';
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkOrderByItem($this);
diff --git a/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php b/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php
index 8a0e0d04e..e4ffe79b2 100644
--- a/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php
@@ -21,12 +21,23 @@ namespace Doctrine\ORM\Query\AST;
class PartialObjectExpression extends Node
{
+ /**
+ * @var string
+ */
public $identificationVariable;
+
+ /**
+ * @var array
+ */
public $partialFieldSet;
+ /**
+ * @param string $identificationVariable
+ * @param array $partialFieldSet
+ */
public function __construct($identificationVariable, array $partialFieldSet)
{
$this->identificationVariable = $identificationVariable;
$this->partialFieldSet = $partialFieldSet;
}
-}
\ No newline at end of file
+}
diff --git a/lib/Doctrine/ORM/Query/AST/PathExpression.php b/lib/Doctrine/ORM/Query/AST/PathExpression.php
index 1b2774203..37674b6fd 100644
--- a/lib/Doctrine/ORM/Query/AST/PathExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/PathExpression.php
@@ -39,11 +39,31 @@ class PathExpression extends Node
const TYPE_SINGLE_VALUED_ASSOCIATION = 4;
const TYPE_STATE_FIELD = 8;
+ /**
+ * @var int
+ */
public $type;
+
+ /**
+ * @var int
+ */
public $expectedType;
+
+ /**
+ * @var string
+ */
public $identificationVariable;
+
+ /**
+ * @var string|null
+ */
public $field;
+ /**
+ * @param int $expectedType
+ * @param string $identificationVariable
+ * @param string|null $field
+ */
public function __construct($expectedType, $identificationVariable, $field = null)
{
$this->expectedType = $expectedType;
@@ -51,6 +71,9 @@ class PathExpression extends Node
$this->field = $field;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkPathExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php b/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
index 64a764e90..15be95234 100644
--- a/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
@@ -21,7 +21,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -30,35 +29,53 @@ namespace Doctrine\ORM\Query\AST;
*/
class QuantifiedExpression extends Node
{
+ /**
+ * @var string
+ */
public $type;
+
+ /**
+ * @var Subselect
+ */
public $subselect;
+ /**
+ * @param Subselect $subselect
+ */
public function __construct($subselect)
{
$this->subselect = $subselect;
}
+ /**
+ * @return bool
+ */
public function isAll()
{
return strtoupper($this->type) == 'ALL';
}
+ /**
+ * @return bool
+ */
public function isAny()
{
return strtoupper($this->type) == 'ANY';
}
+ /**
+ * @return bool
+ */
public function isSome()
{
return strtoupper($this->type) == 'SOME';
}
/**
- * @override
+ * {@inheritdoc}
*/
public function dispatch($sqlWalker)
{
return $sqlWalker->walkQuantifiedExpression($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php b/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
index facd0bb3b..72a2ea9aa 100644
--- a/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
+++ b/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,15 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class RangeVariableDeclaration extends Node
{
+ /**
+ * @var string
+ */
public $abstractSchemaName;
+
+ /**
+ * @var string
+ */
public $aliasIdentificationVariable;
+ /**
+ * @param string $abstractSchemaName
+ * @param string $aliasIdentificationVar
+ */
public function __construct($abstractSchemaName, $aliasIdentificationVar)
{
$this->abstractSchemaName = $abstractSchemaName;
$this->aliasIdentificationVariable = $aliasIdentificationVar;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($walker)
{
return $walker->walkRangeVariableDeclaration($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SelectClause.php b/lib/Doctrine/ORM/Query/AST/SelectClause.php
index be76a4fb6..1df143677 100644
--- a/lib/Doctrine/ORM/Query/AST/SelectClause.php
+++ b/lib/Doctrine/ORM/Query/AST/SelectClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,15 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class SelectClause extends Node
{
+ /**
+ * @var bool
+ */
public $isDistinct;
+
+ /**
+ * @var array
+ */
public $selectExpressions = array();
+ /**
+ * @param array $selectExpressions
+ * @param bool $isDistinct
+ */
public function __construct(array $selectExpressions, $isDistinct)
{
$this->isDistinct = $isDistinct;
$this->selectExpressions = $selectExpressions;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSelectClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SelectExpression.php b/lib/Doctrine/ORM/Query/AST/SelectExpression.php
index 14ca85083..418701399 100644
--- a/lib/Doctrine/ORM/Query/AST/SelectExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/SelectExpression.php
@@ -23,7 +23,6 @@ namespace Doctrine\ORM\Query\AST;
* SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression |
* (AggregateExpression | "(" Subselect ")") [["AS"] ["HIDDEN"] FieldAliasIdentificationVariable]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -32,10 +31,26 @@ namespace Doctrine\ORM\Query\AST;
*/
class SelectExpression extends Node
{
+ /**
+ * @var mixed
+ */
public $expression;
+
+ /**
+ * @var string|null
+ */
public $fieldIdentificationVariable;
+
+ /**
+ * @var bool
+ */
public $hiddenAliasResultVariable;
+ /**
+ * @param mixed $expression
+ * @param string|null $fieldIdentificationVariable
+ * @param bool $hiddenAliasResultVariable
+ */
public function __construct($expression, $fieldIdentificationVariable, $hiddenAliasResultVariable = false)
{
$this->expression = $expression;
@@ -43,6 +58,9 @@ class SelectExpression extends Node
$this->hiddenAliasResultVariable = $hiddenAliasResultVariable;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSelectExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SelectStatement.php b/lib/Doctrine/ORM/Query/AST/SelectStatement.php
index d91d26f1a..d84f7258a 100644
--- a/lib/Doctrine/ORM/Query/AST/SelectStatement.php
+++ b/lib/Doctrine/ORM/Query/AST/SelectStatement.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* SelectStatement = SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,18 +30,49 @@ namespace Doctrine\ORM\Query\AST;
*/
class SelectStatement extends Node
{
+ /**
+ * @var SelectClause
+ */
public $selectClause;
+
+ /**
+ * @var FromClause
+ */
public $fromClause;
+
+ /**
+ * @var WhereClause|null
+ */
public $whereClause;
+
+ /**
+ * @var GroupByClause|null
+ */
public $groupByClause;
+
+ /**
+ * @var HavingClause|null
+ */
public $havingClause;
+
+ /**
+ * @var OrderByClause|null
+ */
public $orderByClause;
- public function __construct($selectClause, $fromClause) {
+ /**
+ * @param SelectClause $selectClause
+ * @param FromClause $fromClause
+ */
+ public function __construct($selectClause, $fromClause)
+ {
$this->selectClause = $selectClause;
$this->fromClause = $fromClause;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSelectStatement($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
index 8d91c9b0b..9bd485045 100644
--- a/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class SimpleArithmeticExpression extends Node
{
+ /**
+ * @var array
+ */
public $arithmeticTerms = array();
+ /**
+ * @param array $arithmeticTerms
+ */
public function __construct(array $arithmeticTerms)
{
$this->arithmeticTerms = $arithmeticTerms;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSimpleArithmeticExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php
index bd593ee57..5272f3962 100644
--- a/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php
@@ -32,10 +32,26 @@ namespace Doctrine\ORM\Query\AST;
*/
class SimpleCaseExpression extends Node
{
+ /**
+ * @var PathExpression
+ */
public $caseOperand = null;
+
+ /**
+ * @var array
+ */
public $simpleWhenClauses = array();
+
+ /**
+ * @var mixed
+ */
public $elseScalarExpression = null;
+ /**
+ * @param PathExpression $caseOperand
+ * @param array $simpleWhenClauses
+ * @param mixed $elseScalarExpression
+ */
public function __construct($caseOperand, array $simpleWhenClauses, $elseScalarExpression)
{
$this->caseOperand = $caseOperand;
@@ -43,6 +59,9 @@ class SimpleCaseExpression extends Node
$this->elseScalarExpression = $elseScalarExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSimpleCaseExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php b/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
index 95a619878..92361da45 100644
--- a/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
+++ b/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,15 +30,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class SimpleSelectClause extends Node
{
+ /**
+ * @var bool
+ */
public $isDistinct = false;
+
+ /**
+ * @var SimpleSelectExpression
+ */
public $simpleSelectExpression;
+ /**
+ * @param SimpleSelectExpression $simpleSelectExpression
+ * @param bool $isDistinct
+ */
public function __construct($simpleSelectExpression, $isDistinct)
{
$this->simpleSelectExpression = $simpleSelectExpression;
$this->isDistinct = $isDistinct;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSimpleSelectClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
index 25e927e2b..e556835ed 100644
--- a/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
+++ b/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
@@ -23,7 +23,6 @@ namespace Doctrine\ORM\Query\AST;
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable
* | (AggregateExpression [["AS"] FieldAliasIdentificationVariable])
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -32,14 +31,27 @@ namespace Doctrine\ORM\Query\AST;
*/
class SimpleSelectExpression extends Node
{
+ /**
+ * @var Node
+ */
public $expression;
+
+ /**
+ * @var string
+ */
public $fieldIdentificationVariable;
+ /**
+ * @param Node $expression
+ */
public function __construct($expression)
{
$this->expression = $expression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSimpleSelectExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php b/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php
index fabe44961..4f60881d4 100644
--- a/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php
+++ b/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php
@@ -32,15 +32,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class SimpleWhenClause extends Node
{
+ /**
+ * @var mixed
+ */
public $caseScalarExpression = null;
+
+ /**
+ * @var mixed
+ */
public $thenScalarExpression = null;
+ /**
+ * @param mixed $caseScalarExpression
+ * @param mixed $thenScalarExpression
+ */
public function __construct($caseScalarExpression, $thenScalarExpression)
{
$this->caseScalarExpression = $caseScalarExpression;
$this->thenScalarExpression = $thenScalarExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkWhenClauseExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/Subselect.php b/lib/Doctrine/ORM/Query/AST/Subselect.php
index 46c0e9678..ce08266f0 100644
--- a/lib/Doctrine/ORM/Query/AST/Subselect.php
+++ b/lib/Doctrine/ORM/Query/AST/Subselect.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,19 +30,49 @@ namespace Doctrine\ORM\Query\AST;
*/
class Subselect extends Node
{
+ /**
+ * @var SimpleSelectClause
+ */
public $simpleSelectClause;
+
+ /**
+ * @var SubselectFromClause
+ */
public $subselectFromClause;
+
+ /**
+ * @var WhereClause|null
+ */
public $whereClause;
+
+ /**
+ * @var GroupByClause|null
+ */
public $groupByClause;
+
+ /**
+ * @var HavingClause|null
+ */
public $havingClause;
+
+ /**
+ * @var OrderByClause|null
+ */
public $orderByClause;
+ /**
+ * @param SimpleSelectClause $simpleSelectClause
+ * @param SubselectFromClause $subselectFromClause
+ */
public function __construct($simpleSelectClause, $subselectFromClause)
{
$this->simpleSelectClause = $simpleSelectClause;
$this->subselectFromClause = $subselectFromClause;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSubselect($this);
diff --git a/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php b/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
index 3a6b54779..8d009fcfd 100644
--- a/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
+++ b/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class SubselectFromClause extends Node
{
+ /**
+ * @var array
+ */
public $identificationVariableDeclarations = array();
+ /**
+ * @param array $identificationVariableDeclarations
+ */
public function __construct(array $identificationVariableDeclarations)
{
$this->identificationVariableDeclarations = $identificationVariableDeclarations;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkSubselectFromClause($this);
diff --git a/lib/Doctrine/ORM/Query/AST/UpdateClause.php b/lib/Doctrine/ORM/Query/AST/UpdateClause.php
index 4188cf58e..430ed14eb 100644
--- a/lib/Doctrine/ORM/Query/AST/UpdateClause.php
+++ b/lib/Doctrine/ORM/Query/AST/UpdateClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}*
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,19 +30,36 @@ namespace Doctrine\ORM\Query\AST;
*/
class UpdateClause extends Node
{
+ /**
+ * @var string
+ */
public $abstractSchemaName;
+
+ /**
+ * @var string
+ */
public $aliasIdentificationVariable;
+
+ /**
+ * @var array
+ */
public $updateItems = array();
+ /**
+ * @param string $abstractSchemaName
+ * @param array $updateItems
+ */
public function __construct($abstractSchemaName, array $updateItems)
{
$this->abstractSchemaName = $abstractSchemaName;
$this->updateItems = $updateItems;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkUpdateClause($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/UpdateItem.php b/lib/Doctrine/ORM/Query/AST/UpdateItem.php
index 2a13391f3..f1a288cae 100644
--- a/lib/Doctrine/ORM/Query/AST/UpdateItem.php
+++ b/lib/Doctrine/ORM/Query/AST/UpdateItem.php
@@ -24,7 +24,6 @@ namespace Doctrine\ORM\Query\AST;
* NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
* EnumPrimary | SimpleEntityExpression | "NULL"
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -33,18 +32,31 @@ namespace Doctrine\ORM\Query\AST;
*/
class UpdateItem extends Node
{
+ /**
+ * @var PathExpression
+ */
public $pathExpression;
+
+ /**
+ * @var InputParameter|ArithmeticExpression|null
+ */
public $newValue;
+ /**
+ * @param PathExpression $pathExpression
+ * @param InputParameter|ArithmeticExpression|null $newValue
+ */
public function __construct($pathExpression, $newValue)
{
$this->pathExpression = $pathExpression;
$this->newValue = $newValue;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkUpdateItem($this);
}
}
-
diff --git a/lib/Doctrine/ORM/Query/AST/UpdateStatement.php b/lib/Doctrine/ORM/Query/AST/UpdateStatement.php
index decae96e9..c578efef4 100644
--- a/lib/Doctrine/ORM/Query/AST/UpdateStatement.php
+++ b/lib/Doctrine/ORM/Query/AST/UpdateStatement.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* UpdateStatement = UpdateClause [WhereClause]
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,14 +30,27 @@ namespace Doctrine\ORM\Query\AST;
*/
class UpdateStatement extends Node
{
+ /**
+ * @var UpdateClause
+ */
public $updateClause;
+
+ /**
+ * @var WhereClause|null
+ */
public $whereClause;
+ /**
+ * @param UpdateClause $updateClause
+ */
public function __construct($updateClause)
{
$this->updateClause = $updateClause;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkUpdateStatement($this);
diff --git a/lib/Doctrine/ORM/Query/AST/WhenClause.php b/lib/Doctrine/ORM/Query/AST/WhenClause.php
index ca91f575f..01c0330f4 100644
--- a/lib/Doctrine/ORM/Query/AST/WhenClause.php
+++ b/lib/Doctrine/ORM/Query/AST/WhenClause.php
@@ -32,15 +32,29 @@ namespace Doctrine\ORM\Query\AST;
*/
class WhenClause extends Node
{
+ /**
+ * @var ConditionalExpression
+ */
public $caseConditionExpression = null;
+
+ /**
+ * @var mixed
+ */
public $thenScalarExpression = null;
+ /**
+ * @param ConditionalExpression $caseConditionExpression
+ * @param mixed $thenScalarExpression
+ */
public function __construct($caseConditionExpression, $thenScalarExpression)
{
$this->caseConditionExpression = $caseConditionExpression;
$this->thenScalarExpression = $thenScalarExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkWhenClauseExpression($this);
diff --git a/lib/Doctrine/ORM/Query/AST/WhereClause.php b/lib/Doctrine/ORM/Query/AST/WhereClause.php
index 0b9f16024..e6597752f 100644
--- a/lib/Doctrine/ORM/Query/AST/WhereClause.php
+++ b/lib/Doctrine/ORM/Query/AST/WhereClause.php
@@ -22,7 +22,6 @@ namespace Doctrine\ORM\Query\AST;
/**
* WhereClause ::= "WHERE" ConditionalExpression
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -31,13 +30,22 @@ namespace Doctrine\ORM\Query\AST;
*/
class WhereClause extends Node
{
+ /**
+ * @var ConditionalExpression
+ */
public $conditionalExpression;
+ /**
+ * @param ConditionalExpression $conditionalExpression
+ */
public function __construct($conditionalExpression)
{
$this->conditionalExpression = $conditionalExpression;
}
+ /**
+ * {@inheritdoc}
+ */
public function dispatch($sqlWalker)
{
return $sqlWalker->walkWhereClause($this);
diff --git a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
index d20905a09..3d6ed4353 100644
--- a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php
@@ -53,6 +53,11 @@ abstract class AbstractSqlExecutor
return $this->_sqlStatements;
}
+ /**
+ * @param \Doctrine\DBAL\Cache\QueryCacheProfile $qcp
+ *
+ * @return void
+ */
public function setQueryCacheProfile(QueryCacheProfile $qcp)
{
$this->queryCacheProfile = $qcp;
@@ -61,9 +66,10 @@ abstract class AbstractSqlExecutor
/**
* Executes all sql statements.
*
- * @param \Doctrine\DBAL\Connection $conn The database connection that is used to execute the queries.
- * @param array $params The parameters.
- * @param array $types The parameter types.
+ * @param Connection $conn The database connection that is used to execute the queries.
+ * @param array $params The parameters.
+ * @param array $types The parameter types.
+ *
* @return \Doctrine\DBAL\Driver\Statement
*/
abstract public function execute(Connection $conn, array $params, array $types);
diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
index 1ead1eafa..13af55905 100644
--- a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
@@ -33,15 +33,27 @@ use Doctrine\ORM\Query\AST;
*/
class MultiTableDeleteExecutor extends AbstractSqlExecutor
{
+ /**
+ * @var string
+ */
private $_createTempTableSql;
+
+ /**
+ * @var string
+ */
private $_dropTempTableSql;
+
+ /**
+ * @var string
+ */
private $_insertSql;
/**
* Initializes a new MultiTableDeleteExecutor.
*
- * @param Node $AST The root AST node of the DQL query.
- * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST.
+ * @param \Doctrine\ORM\Query\AST\Node $AST The root AST node of the DQL query.
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker The walker used for SQL generation from the AST.
+ *
* @internal Any SQL construction and preparation takes place in the constructor for
* best performance. With a query cache the executor will be cached.
*/
diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
index 7dc3fed82..cc15cea92 100644
--- a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
@@ -34,17 +34,37 @@ use Doctrine\ORM\Query\AST;
*/
class MultiTableUpdateExecutor extends AbstractSqlExecutor
{
+ /**
+ * @var string
+ */
private $_createTempTableSql;
+
+ /**
+ * @var string
+ */
private $_dropTempTableSql;
+
+ /**
+ * @var string
+ */
private $_insertSql;
+
+ /**
+ * @var array
+ */
private $_sqlParameters = array();
+
+ /**
+ * @var int
+ */
private $_numParametersInUpdateClause = 0;
/**
* Initializes a new MultiTableUpdateExecutor.
*
- * @param Node $AST The root AST node of the DQL query.
- * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST.
+ * @param \Doctrine\ORM\Query\AST\Node $AST The root AST node of the DQL query.
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker The walker used for SQL generation from the AST.
+ *
* @internal Any SQL construction and preparation takes place in the constructor for
* best performance. With a query cache the executor will be cached.
*/
diff --git a/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php b/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php
index c5ce9b5fa..f652fbe8c 100644
--- a/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php
@@ -33,6 +33,10 @@ use Doctrine\ORM\Query\SqlWalker;
*/
class SingleSelectExecutor extends AbstractSqlExecutor
{
+ /**
+ * @param \Doctrine\ORM\Query\AST\SelectStatement $AST
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
+ */
public function __construct(SelectStatement $AST, SqlWalker $sqlWalker)
{
$this->_sqlStatements = $sqlWalker->walkSelectStatement($AST);
diff --git a/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php b/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php
index ea4e91897..695176d5b 100644
--- a/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php
+++ b/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php
@@ -34,6 +34,10 @@ use Doctrine\ORM\Query\AST;
*/
class SingleTableDeleteUpdateExecutor extends AbstractSqlExecutor
{
+ /**
+ * @param \Doctrine\ORM\Query\AST\Node $AST
+ * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker
+ */
public function __construct(AST\Node $AST, $sqlWalker)
{
if ($AST instanceof AST\UpdateStatement) {
diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php
index db461f9fd..90c706137 100644
--- a/lib/Doctrine/ORM/Query/Expr.php
+++ b/lib/Doctrine/ORM/Query/Expr.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query;
/**
- * This class is used to generate DQL expressions via a set of PHP static functions
- *
- *
+ * This class is used to generate DQL expressions via a set of PHP static functions.
+
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -43,9 +42,10 @@ class Expr
* $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2'));
*
* @param \Doctrine\ORM\Query\Expr\Comparison |
- * \Doctrine\ORM\Query\Expr\Func |
- * \Doctrine\ORM\Query\Expr\Orx
- * $x Optional clause. Defaults = null, but requires at least one defined when converting to string.
+ * \Doctrine\ORM\Query\Expr\Func |
+ * \Doctrine\ORM\Query\Expr\Orx
+ * $x Optional clause. Defaults to null, but requires at least one defined when converting to string.
+ *
* @return Expr\Andx
*/
public function andX($x = null)
@@ -62,8 +62,9 @@ class Expr
* // (u.type = ?1) OR (u.role = ?2)
* $q->where($q->expr()->orX('u.type = ?1', 'u.role = ?2'));
*
- * @param mixed $x Optional clause. Defaults = null, but requires
+ * @param mixed $x Optional clause. Defaults to null, but requires
* at least one defined when converting to string.
+ *
* @return Expr\Orx
*/
public function orX($x = null)
@@ -74,7 +75,8 @@ class Expr
/**
* Creates an ASCending order expression.
*
- * @param $sort
+ * @param mixed $expr
+ *
* @return Expr\OrderBy
*/
public function asc($expr)
@@ -85,7 +87,8 @@ class Expr
/**
* Creates a DESCending order expression.
*
- * @param $sort
+ * @param mixed $expr
+ *
* @return Expr\OrderBy
*/
public function desc($expr)
@@ -103,8 +106,9 @@ class Expr
* // u.id = ?1
* $expr->eq('u.id', '?1');
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function eq($x, $y)
@@ -121,8 +125,9 @@ class Expr
* // u.id <> ?1
* $q->where($q->expr()->neq('u.id', '?1'));
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function neq($x, $y)
@@ -139,8 +144,9 @@ class Expr
* // u.id < ?1
* $q->where($q->expr()->lt('u.id', '?1'));
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function lt($x, $y)
@@ -157,8 +163,9 @@ class Expr
* // u.id <= ?1
* $q->where($q->expr()->lte('u.id', '?1'));
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function lte($x, $y)
@@ -175,8 +182,9 @@ class Expr
* // u.id > ?1
* $q->where($q->expr()->gt('u.id', '?1'));
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function gt($x, $y)
@@ -193,8 +201,9 @@ class Expr
* // u.id >= ?1
* $q->where($q->expr()->gte('u.id', '?1'));
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Comparison
*/
public function gte($x, $y)
@@ -206,6 +215,7 @@ class Expr
* Creates an instance of AVG() function, with the given argument.
*
* @param mixed $x Argument to be used in AVG() function.
+ *
* @return Expr\Func
*/
public function avg($x)
@@ -217,6 +227,7 @@ class Expr
* Creates an instance of MAX() function, with the given argument.
*
* @param mixed $x Argument to be used in MAX() function.
+ *
* @return Expr\Func
*/
public function max($x)
@@ -228,6 +239,7 @@ class Expr
* Creates an instance of MIN() function, with the given argument.
*
* @param mixed $x Argument to be used in MIN() function.
+ *
* @return Expr\Func
*/
public function min($x)
@@ -239,6 +251,7 @@ class Expr
* Creates an instance of COUNT() function, with the given argument.
*
* @param mixed $x Argument to be used in COUNT() function.
+ *
* @return Expr\Func
*/
public function count($x)
@@ -250,6 +263,7 @@ class Expr
* Creates an instance of COUNT(DISTINCT) function, with the given argument.
*
* @param mixed $x Argument to be used in COUNT(DISTINCT) function.
+ *
* @return string
*/
public function countDistinct($x)
@@ -261,6 +275,7 @@ class Expr
* Creates an instance of EXISTS() function, with the given DQL Subquery.
*
* @param mixed $subquery DQL Subquery to be used in EXISTS() function.
+ *
* @return Expr\Func
*/
public function exists($subquery)
@@ -272,6 +287,7 @@ class Expr
* Creates an instance of ALL() function, with the given DQL Subquery.
*
* @param mixed $subquery DQL Subquery to be used in ALL() function.
+ *
* @return Expr\Func
*/
public function all($subquery)
@@ -283,6 +299,7 @@ class Expr
* Creates a SOME() function expression with the given DQL subquery.
*
* @param mixed $subquery DQL Subquery to be used in SOME() function.
+ *
* @return Expr\Func
*/
public function some($subquery)
@@ -294,6 +311,7 @@ class Expr
* Creates an ANY() function expression with the given DQL subquery.
*
* @param mixed $subquery DQL Subquery to be used in ANY() function.
+ *
* @return Expr\Func
*/
public function any($subquery)
@@ -305,6 +323,7 @@ class Expr
* Creates a negation expression of the given restriction.
*
* @param mixed $restriction Restriction to be used in NOT() function.
+ *
* @return Expr\Func
*/
public function not($restriction)
@@ -316,6 +335,7 @@ class Expr
* Creates an ABS() function expression with the given argument.
*
* @param mixed $x Argument to be used in ABS() function.
+ *
* @return Expr\Func
*/
public function abs($x)
@@ -333,8 +353,9 @@ class Expr
* // u.salary * u.percentAnualSalaryIncrease
* $q->expr()->prod('u.salary', 'u.percentAnualSalaryIncrease')
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Math
*/
public function prod($x, $y)
@@ -351,8 +372,9 @@ class Expr
* // u.monthlySubscriptionCount - 1
* $q->expr()->diff('u.monthlySubscriptionCount', '1')
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Math
*/
public function diff($x, $y)
@@ -369,8 +391,9 @@ class Expr
* // u.numChildren + 1
* $q->expr()->diff('u.numChildren', '1')
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Math
*/
public function sum($x, $y)
@@ -387,8 +410,9 @@ class Expr
* // u.total / u.period
* $expr->quot('u.total', 'u.period')
*
- * @param mixed $x Left expression
- * @param mixed $y Right expression
+ * @param mixed $x Left expression.
+ * @param mixed $y Right expression.
+ *
* @return Expr\Math
*/
public function quot($x, $y)
@@ -400,6 +424,7 @@ class Expr
* Creates a SQRT() function expression with the given argument.
*
* @param mixed $x Argument to be used in SQRT() function.
+ *
* @return Expr\Func
*/
public function sqrt($x)
@@ -410,8 +435,9 @@ class Expr
/**
* Creates an IN() expression with the given arguments.
*
- * @param string $x Field in string format to be restricted by IN() function
- * @param mixed $y Argument to be used in IN() function.
+ * @param string $x Field in string format to be restricted by IN() function.
+ * @param mixed $y Argument to be used in IN() function.
+ *
* @return Expr\Func
*/
public function in($x, $y)
@@ -429,8 +455,9 @@ class Expr
/**
* Creates a NOT IN() expression with the given arguments.
*
- * @param string $x Field in string format to be restricted by NOT IN() function
+ * @param string $x Field in string format to be restricted by NOT IN() function.
* @param mixed $y Argument to be used in NOT IN() function.
+ *
* @return Expr\Func
*/
public function notIn($x, $y)
@@ -448,7 +475,8 @@ class Expr
/**
* Creates an IS NULL expression with the given arguments.
*
- * @param string $x Field in string format to be restricted by IS NULL
+ * @param string $x Field in string format to be restricted by IS NULL.
+ *
* @return string
*/
public function isNull($x)
@@ -459,7 +487,8 @@ class Expr
/**
* Creates an IS NOT NULL expression with the given arguments.
*
- * @param string $x Field in string format to be restricted by IS NOT NULL
+ * @param string $x Field in string format to be restricted by IS NOT NULL.
+ *
* @return string
*/
public function isNotNull($x)
@@ -471,7 +500,8 @@ class Expr
* Creates a LIKE() comparison expression with the given arguments.
*
* @param string $x Field in string format to be inspected by LIKE() comparison.
- * @param mixed $y Argument to be used in LIKE() comparison.
+ * @param mixed $y Argument to be used in LIKE() comparison.
+ *
* @return Expr\Comparison
*/
public function like($x, $y)
@@ -483,7 +513,8 @@ class Expr
* Creates a NOT LIKE() comparison expression with the given arguments.
*
* @param string $x Field in string format to be inspected by LIKE() comparison.
- * @param mixed $y Argument to be used in LIKE() comparison.
+ * @param mixed $y Argument to be used in LIKE() comparison.
+ *
* @return Expr\Comparison
*/
public function notLike($x, $y)
@@ -495,7 +526,8 @@ class Expr
* Creates a CONCAT() function expression with the given arguments.
*
* @param mixed $x First argument to be used in CONCAT() function.
- * @param mixed $x Second argument to be used in CONCAT() function.
+ * @param mixed $y Second argument to be used in CONCAT() function.
+ *
* @return Expr\Func
*/
public function concat($x, $y)
@@ -506,9 +538,10 @@ class Expr
/**
* Creates a SUBSTRING() function expression with the given arguments.
*
- * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function.
- * @param integer $from Initial offset to start cropping string. May accept negative values.
- * @param integer $len Length of crop. May accept negative values.
+ * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function.
+ * @param int $from Initial offset to start cropping string. May accept negative values.
+ * @param int|null $len Length of crop. May accept negative values.
+ *
* @return Expr\Func
*/
public function substring($x, $from, $len = null)
@@ -524,6 +557,7 @@ class Expr
* Creates a LOWER() function expression with the given argument.
*
* @param mixed $x Argument to be used in LOWER() function.
+ *
* @return Expr\Func A LOWER function expression.
*/
public function lower($x)
@@ -535,6 +569,7 @@ class Expr
* Creates an UPPER() function expression with the given argument.
*
* @param mixed $x Argument to be used in UPPER() function.
+ *
* @return Expr\Func An UPPER function expression.
*/
public function upper($x)
@@ -546,6 +581,7 @@ class Expr
* Creates a LENGTH() function expression with the given argument.
*
* @param mixed $x Argument to be used as argument of LENGTH() function.
+ *
* @return Expr\Func A LENGTH function expression.
*/
public function length($x)
@@ -557,6 +593,7 @@ class Expr
* Creates a literal expression of the given argument.
*
* @param mixed $literal Argument to be converted to literal.
+ *
* @return Expr\Literal
*/
public function literal($literal)
@@ -568,6 +605,7 @@ class Expr
* Quotes a literal value, if necessary, according to the DQL syntax.
*
* @param mixed $literal The literal value.
+ *
* @return string
*/
private function _quoteLiteral($literal)
@@ -584,9 +622,10 @@ class Expr
/**
* Creates an instance of BETWEEN() function, with the given argument.
*
- * @param mixed $val Valued to be inspected by range values.
- * @param integer $x Starting range value to be used in BETWEEN() function.
- * @param integer $y End point value to be used in BETWEEN() function.
+ * @param mixed $val Valued to be inspected by range values.
+ * @param integer $x Starting range value to be used in BETWEEN() function.
+ * @param integer $y End point value to be used in BETWEEN() function.
+ *
* @return Expr\Func A BETWEEN expression.
*/
public function between($val, $x, $y)
@@ -598,6 +637,7 @@ class Expr
* Creates an instance of TRIM() function, with the given argument.
*
* @param mixed $x Argument to be used as argument of TRIM() function.
+ *
* @return Expr\Func a TRIM expression.
*/
public function trim($x)
diff --git a/lib/Doctrine/ORM/Query/Expr/Andx.php b/lib/Doctrine/ORM/Query/Expr/Andx.php
index 10b5e8e6e..432f714f6 100644
--- a/lib/Doctrine/ORM/Query/Expr/Andx.php
+++ b/lib/Doctrine/ORM/Query/Expr/Andx.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL and parts
+ * Expression class for building DQL and parts.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php
index a2bc98cc7..28771890c 100644
--- a/lib/Doctrine/ORM/Query/Expr/Base.php
+++ b/lib/Doctrine/ORM/Query/Expr/Base.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Abstract base Expr class for building DQL parts
+ * Abstract base Expr class for building DQL parts.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -65,8 +64,9 @@ abstract class Base
}
/**
- * @param array $args
- * @return Base
+ * @param array $args
+ *
+ * @return Base
*/
public function addMultiple($args = array())
{
@@ -78,8 +78,11 @@ abstract class Base
}
/**
- * @param mixed $arg
- * @return Base
+ * @param mixed $arg
+ *
+ * @return Base
+ *
+ * @throws \InvalidArgumentException
*/
public function add($arg)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/Comparison.php b/lib/Doctrine/ORM/Query/Expr/Comparison.php
index 52070df60..4103dcea9 100644
--- a/lib/Doctrine/ORM/Query/Expr/Comparison.php
+++ b/lib/Doctrine/ORM/Query/Expr/Comparison.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for DQL comparison expressions
+ * Expression class for DQL comparison expressions.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -56,9 +55,9 @@ class Comparison
/**
* Creates a comparison expression with the given arguments.
*
- * @param mixed $leftExpr
- * @param string $operator
- * @param mixed $rightExpr
+ * @param mixed $leftExpr
+ * @param string $operator
+ * @param mixed $rightExpr
*/
public function __construct($leftExpr, $operator, $rightExpr)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/Composite.php b/lib/Doctrine/ORM/Query/Expr/Composite.php
index cc0e0e8f3..4d9a25198 100644
--- a/lib/Doctrine/ORM/Query/Expr/Composite.php
+++ b/lib/Doctrine/ORM/Query/Expr/Composite.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL and parts
+ * Expression class for building DQL and parts.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -49,10 +48,10 @@ class Composite extends Base
return implode($this->separator, $components);
}
-
/**
- * @param string $part
- * @return string
+ * @param string $part
+ *
+ * @return string
*/
private function processQueryPart($part)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/From.php b/lib/Doctrine/ORM/Query/Expr/From.php
index 3a37703d2..9dcce9bbe 100644
--- a/lib/Doctrine/ORM/Query/Expr/From.php
+++ b/lib/Doctrine/ORM/Query/Expr/From.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for DQL from
+ * Expression class for DQL from.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -47,9 +46,9 @@ class From
protected $indexBy;
/**
- * @param string $from The class name.
- * @param string $alias The alias of the class.
- * @param string $indexBy The index for the from.
+ * @param string $from The class name.
+ * @param string $alias The alias of the class.
+ * @param string $indexBy The index for the from.
*/
public function __construct($from, $alias, $indexBy = null)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/Func.php b/lib/Doctrine/ORM/Query/Expr/Func.php
index 6917dd230..b4ed07cd3 100644
--- a/lib/Doctrine/ORM/Query/Expr/Func.php
+++ b/lib/Doctrine/ORM/Query/Expr/Func.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for generating DQL functions
+ * Expression class for generating DQL functions.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -44,8 +43,8 @@ class Func
/**
* Creates a function, with the given argument.
*
- * @param string $name
- * @param array $arguments
+ * @param string $name
+ * @param array $arguments
*/
public function __construct($name, $arguments)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/GroupBy.php b/lib/Doctrine/ORM/Query/Expr/GroupBy.php
index 40bb838ff..efa3582bd 100644
--- a/lib/Doctrine/ORM/Query/Expr/GroupBy.php
+++ b/lib/Doctrine/ORM/Query/Expr/GroupBy.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL Group By parts
+ * Expression class for building DQL Group By parts.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
diff --git a/lib/Doctrine/ORM/Query/Expr/Join.php b/lib/Doctrine/ORM/Query/Expr/Join.php
index 41f454fcd..c7ca935eb 100644
--- a/lib/Doctrine/ORM/Query/Expr/Join.php
+++ b/lib/Doctrine/ORM/Query/Expr/Join.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for DQL from
+ * Expression class for DQL join.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -68,12 +67,12 @@ class Join
protected $indexBy;
/**
- * @param string $joinType The condition type constant. Either INNER_JOIN or LEFT_JOIN.
- * @param string $join The relationship to join
- * @param string $alias The alias of the join
- * @param string $conditionType The condition type constant. Either ON or WITH.
- * @param string $condition The condition for the join
- * @param string $indexBy The index for the join
+ * @param string $joinType The condition type constant. Either INNER_JOIN or LEFT_JOIN.
+ * @param string $join The relationship to join.
+ * @param string|null $alias The alias of the join.
+ * @param string|null $conditionType The condition type constant. Either ON or WITH.
+ * @param string|null $condition The condition for the join.
+ * @param string|null $indexBy The index for the join.
*/
public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null)
{
@@ -133,7 +132,6 @@ class Join
return $this->indexBy;
}
-
/**
* @return string
*/
diff --git a/lib/Doctrine/ORM/Query/Expr/Literal.php b/lib/Doctrine/ORM/Query/Expr/Literal.php
index 991b04430..98cee79d7 100644
--- a/lib/Doctrine/ORM/Query/Expr/Literal.php
+++ b/lib/Doctrine/ORM/Query/Expr/Literal.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for generating DQL functions
+ * Expression class for generating DQL functions.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -48,5 +47,4 @@ class Literal extends Base
{
return $this->parts;
}
-
}
diff --git a/lib/Doctrine/ORM/Query/Expr/Math.php b/lib/Doctrine/ORM/Query/Expr/Math.php
index a41c848d8..9bf800de8 100644
--- a/lib/Doctrine/ORM/Query/Expr/Math.php
+++ b/lib/Doctrine/ORM/Query/Expr/Math.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for DQL math statements
+ * Expression class for DQL math statements.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -49,9 +48,9 @@ class Math
/**
* Creates a mathematical expression with the given arguments.
*
- * @param mixed $leftExpr
- * @param string $operator
- * @param mixed $rightExpr
+ * @param mixed $leftExpr
+ * @param string $operator
+ * @param mixed $rightExpr
*/
public function __construct($leftExpr, $operator, $rightExpr)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/OrderBy.php b/lib/Doctrine/ORM/Query/Expr/OrderBy.php
index e0e7ffcdb..932548bd6 100644
--- a/lib/Doctrine/ORM/Query/Expr/OrderBy.php
+++ b/lib/Doctrine/ORM/Query/Expr/OrderBy.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL Order By parts
+ * Expression class for building DQL Order By parts.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -57,8 +56,8 @@ class OrderBy
protected $parts = array();
/**
- * @param string $sort
- * @param string $order
+ * @param string|null $sort
+ * @param string|null $order
*/
public function __construct($sort = null, $order = null)
{
@@ -68,8 +67,10 @@ class OrderBy
}
/**
- * @param string $sort
- * @param string $order
+ * @param string $sort
+ * @param string|null $order
+ *
+ * @return void
*/
public function add($sort, $order = null)
{
diff --git a/lib/Doctrine/ORM/Query/Expr/Orx.php b/lib/Doctrine/ORM/Query/Expr/Orx.php
index caecba638..c4ff7ae30 100644
--- a/lib/Doctrine/ORM/Query/Expr/Orx.php
+++ b/lib/Doctrine/ORM/Query/Expr/Orx.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL OR clauses
+ * Expression class for building DQL OR clauses.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
diff --git a/lib/Doctrine/ORM/Query/Expr/Select.php b/lib/Doctrine/ORM/Query/Expr/Select.php
index 804d797d8..21df6c735 100644
--- a/lib/Doctrine/ORM/Query/Expr/Select.php
+++ b/lib/Doctrine/ORM/Query/Expr/Select.php
@@ -20,9 +20,8 @@
namespace Doctrine\ORM\Query\Expr;
/**
- * Expression class for building DQL select statements
+ * Expression class for building DQL select statements.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
diff --git a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php
index 528397ad9..61bc1192d 100644
--- a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php
+++ b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php
@@ -36,12 +36,14 @@ abstract class SQLFilter
{
/**
* The entity manager.
+ *
* @var EntityManager
*/
private $em;
/**
* Parameters for the filter.
+ *
* @var array
*/
private $parameters;
@@ -49,7 +51,7 @@ abstract class SQLFilter
/**
* Constructs the SQLFilter object.
*
- * @param EntityManager $em The EM
+ * @param EntityManager $em The entity manager.
*/
final public function __construct(EntityManager $em)
{
@@ -59,11 +61,11 @@ abstract class SQLFilter
/**
* Sets a parameter that can be used by the filter.
*
- * @param string $name Name of the parameter.
- * @param string $value Value of the parameter.
- * @param string $type The parameter type. If specified, the given value will be run through
- * the type conversion of this type. This is usually not needed for
- * strings and numeric types.
+ * @param string $name Name of the parameter.
+ * @param string $value Value of the parameter.
+ * @param string|null $type The parameter type. If specified, the given value will be run through
+ * the type conversion of this type. This is usually not needed for
+ * strings and numeric types.
*
* @return SQLFilter The current SQL filter.
*/
@@ -93,6 +95,8 @@ abstract class SQLFilter
* @param string $name Name of the parameter.
*
* @return string The SQL escaped parameter to use in a query.
+ *
+ * @throws \InvalidArgumentException
*/
final public function getParameter($name)
{
@@ -116,7 +120,10 @@ abstract class SQLFilter
/**
* Gets the SQL query part to add to a query.
*
- * @return string The constraint SQL if there is available, empty string otherwise
+ * @param ClassMetaData $targetEntity
+ * @param string $targetTableAlias
+ *
+ * @return string The constraint SQL if there is available, empty string otherwise.
*/
abstract public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias);
}
diff --git a/lib/Doctrine/ORM/Query/FilterCollection.php b/lib/Doctrine/ORM/Query/FilterCollection.php
index 66337af6a..61647ba33 100644
--- a/lib/Doctrine/ORM/Query/FilterCollection.php
+++ b/lib/Doctrine/ORM/Query/FilterCollection.php
@@ -30,6 +30,7 @@ use Doctrine\ORM\EntityManager;
class FilterCollection
{
/* Filter STATES */
+
/**
* A filter object is in CLEAN state when it has no changed parameters.
*/
@@ -67,7 +68,7 @@ class FilterCollection
private $filterHash;
/**
- * @var integer $state The current state of this filter
+ * @var integer The current state of this filter.
*/
private $filtersState = self::FILTERS_STATE_CLEAN;
@@ -83,7 +84,7 @@ class FilterCollection
}
/**
- * Get all the enabled filters.
+ * Gets all the enabled filters.
*
* @return array The enabled filters.
*/
@@ -97,9 +98,9 @@ class FilterCollection
*
* @param string $name Name of the filter.
*
- * @throws \InvalidArgumentException If the filter does not exist.
- *
* @return \Doctrine\ORM\Query\Filter\SQLFilter The enabled filter.
+ *
+ * @throws \InvalidArgumentException If the filter does not exist.
*/
public function enable($name)
{
@@ -145,7 +146,7 @@ class FilterCollection
}
/**
- * Get an enabled filter from the collection.
+ * Gets an enabled filter from the collection.
*
* @param string $name Name of the filter.
*
@@ -191,7 +192,7 @@ class FilterCollection
}
/**
- * Set the filter state to dirty.
+ * Sets the filter state to dirty.
*/
public function setFiltersStateDirty()
{
diff --git a/lib/Doctrine/ORM/Query/Lexer.php b/lib/Doctrine/ORM/Query/Lexer.php
index 4692b6ae8..bf0b5f6db 100644
--- a/lib/Doctrine/ORM/Query/Lexer.php
+++ b/lib/Doctrine/ORM/Query/Lexer.php
@@ -113,7 +113,7 @@ class Lexer extends \Doctrine\Common\Lexer
/**
* Creates a new query scanner object.
*
- * @param string $input a query string
+ * @param string $input A query string.
*/
public function __construct($input)
{
diff --git a/lib/Doctrine/ORM/Query/Parameter.php b/lib/Doctrine/ORM/Query/Parameter.php
index 57813cb63..39e2a7a4f 100644
--- a/lib/Doctrine/ORM/Query/Parameter.php
+++ b/lib/Doctrine/ORM/Query/Parameter.php
@@ -20,7 +20,7 @@
namespace Doctrine\ORM\Query;
/**
- * Define a Query Parameter
+ * Defines a Query Parameter.
*
* @link www.doctrine-project.org
* @since 2.3
@@ -29,36 +29,42 @@ namespace Doctrine\ORM\Query;
class Parameter
{
/**
- * @var string Parameter name
+ * The parameter name.
+ *
+ * @var string
*/
private $name;
/**
- * @var mixed Parameter value
+ * The parameter value.
+ *
+ * @var mixed
*/
private $value;
/**
- * @var mixed Parameter type
+ * The parameter type.
+ *
+ * @var mixed
*/
private $type;
/**
* Constructor.
*
- * @param string $name Parameter name
- * @param mixed $value Parameter value
- * @param mixed $type Parameter type
+ * @param string $name Parameter name
+ * @param mixed $value Parameter value
+ * @param mixed $type Parameter type
*/
public function __construct($name, $value, $type = null)
{
- $this->name = trim($name, ':');
+ $this->name = trim($name, ':');
$this->setValue($value, $type);
}
/**
- * Retrieve the Parameter name.
+ * Retrieves the Parameter name.
*
* @return string
*/
@@ -68,7 +74,7 @@ class Parameter
}
/**
- * Retrieve the Parameter value.
+ * Retrieves the Parameter value.
*
* @return mixed
*/
@@ -78,7 +84,7 @@ class Parameter
}
/**
- * Retrieve the Parameter type.
+ * Retrieves the Parameter type.
*
* @return mixed
*/
@@ -88,10 +94,10 @@ class Parameter
}
/**
- * Define the Parameter value.
+ * Defines the Parameter value.
*
- * @param mixed $value Parameter value
- * @param mixed $type Parameter type
+ * @param mixed $value Parameter value.
+ * @param mixed $type Parameter type.
*/
public function setValue($value, $type = null)
{
diff --git a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php
index 0c4df55ee..602dde6d8 100644
--- a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php
+++ b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php
@@ -25,7 +25,6 @@ use Doctrine\DBAL\Types\Type;
/**
* Provides an enclosed support for parameter infering.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -36,13 +35,13 @@ use Doctrine\DBAL\Types\Type;
class ParameterTypeInferer
{
/**
- * Infer type of a given value, returning a compatible constant:
+ * Infers type of a given value, returning a compatible constant:
* - Type (\Doctrine\DBAL\Types\Type::*)
* - Connection (\Doctrine\DBAL\Connection::PARAM_*)
*
- * @param mixed $value Parameter value
+ * @param mixed $value Parameter value.
*
- * @return mixed Parameter type constant
+ * @return mixed Parameter type constant.
*/
public static function inferType($value)
{
diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php
index 4139ea2f4..a978e498a 100644
--- a/lib/Doctrine/ORM/Query/Parser.php
+++ b/lib/Doctrine/ORM/Query/Parser.php
@@ -35,7 +35,11 @@ use Doctrine\ORM\Mapping\ClassMetadata;
*/
class Parser
{
- /** READ-ONLY: Maps BUILT-IN string function names to AST class names. */
+ /**
+ * READ-ONLY: Maps BUILT-IN string function names to AST class names.
+ *
+ * @var array
+ */
private static $_STRING_FUNCTIONS = array(
'concat' => 'Doctrine\ORM\Query\AST\Functions\ConcatFunction',
'substring' => 'Doctrine\ORM\Query\AST\Functions\SubstringFunction',
@@ -45,7 +49,11 @@ class Parser
'identity' => 'Doctrine\ORM\Query\AST\Functions\IdentityFunction',
);
- /** READ-ONLY: Maps BUILT-IN numeric function names to AST class names. */
+ /**
+ * READ-ONLY: Maps BUILT-IN numeric function names to AST class names.
+ *
+ * @var array
+ */
private static $_NUMERIC_FUNCTIONS = array(
'length' => 'Doctrine\ORM\Query\AST\Functions\LengthFunction',
'locate' => 'Doctrine\ORM\Query\AST\Functions\LocateFunction',
@@ -58,7 +66,11 @@ class Parser
'bit_or' => 'Doctrine\ORM\Query\AST\Functions\BitOrFunction',
);
- /** READ-ONLY: Maps BUILT-IN datetime function names to AST class names. */
+ /**
+ * READ-ONLY: Maps BUILT-IN datetime function names to AST class names.
+ *
+ * @var array
+ */
private static $_DATETIME_FUNCTIONS = array(
'current_date' => 'Doctrine\ORM\Query\AST\Functions\CurrentDateFunction',
'current_time' => 'Doctrine\ORM\Query\AST\Functions\CurrentTimeFunction',
@@ -133,7 +145,7 @@ class Parser
private $queryComponents = array();
/**
- * Keeps the nesting level of defined ResultVariables
+ * Keeps the nesting level of defined ResultVariables.
*
* @var integer
*/
@@ -159,10 +171,11 @@ class Parser
private $identVariableExpressions = array();
/**
- * Check if a function is internally defined. Used to prevent overwriting
+ * Checks if a function is internally defined. Used to prevent overwriting
* of built-in functions through user-defined functions.
*
* @param string $functionName
+ *
* @return bool
*/
static public function isInternalFunction($functionName)
@@ -192,6 +205,8 @@ class Parser
* This tree walker will be run last over the AST, after any other walkers.
*
* @param string $className
+ *
+ * @return void
*/
public function setCustomOutputTreeWalker($className)
{
@@ -202,6 +217,8 @@ class Parser
* Adds a custom tree walker for modifying the AST.
*
* @param string $className
+ *
+ * @return void
*/
public function addCustomTreeWalker($className)
{
@@ -239,7 +256,7 @@ class Parser
}
/**
- * Parse and build AST for the given Query.
+ * Parses and builds AST for the given Query.
*
* @return \Doctrine\ORM\Query\AST\SelectStatement |
* \Doctrine\ORM\Query\AST\UpdateStatement |
@@ -284,8 +301,10 @@ class Parser
* If they match, updates the lookahead token; otherwise raises a syntax
* error.
*
- * @param int token type
+ * @param int $token The token type.
+ *
* @return void
+ *
* @throws QueryException If the tokens dont match.
*/
public function match($token)
@@ -301,10 +320,12 @@ class Parser
}
/**
- * Free this parser enabling it to be reused
+ * Frees this parser, enabling it to be reused.
*
- * @param boolean $deep Whether to clean peek and reset errors
- * @param integer $position Position to reset
+ * @param boolean $deep Whether to clean peek and reset errors.
+ * @param integer $position Position to reset.
+ *
+ * @return void
*/
public function free($deep = false, $position = 0)
{
@@ -372,13 +393,14 @@ class Parser
}
/**
- * Fix order of identification variables.
+ * Fixes order of identification variables.
*
* They have to appear in the select clause in the same order as the
* declarations (from ... x join ... y join ... z ...) appear in the query
* as the hydration process relies on that order for proper operation.
*
* @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST
+ *
* @return void
*/
private function fixIdentificationVariableOrder($AST)
@@ -404,8 +426,10 @@ class Parser
/**
* Generates a new syntax error.
*
- * @param string $expected Expected string.
- * @param array $token Got token.
+ * @param string $expected Expected string.
+ * @param array|null $token Got token.
+ *
+ * @return void
*
* @throws \Doctrine\ORM\Query\QueryException
*/
@@ -427,8 +451,10 @@ class Parser
/**
* Generates a new semantical error.
*
- * @param string $message Optional message.
- * @param array $token Optional token.
+ * @param string $message Optional message.
+ * @param array|null $token Optional token.
+ *
+ * @return void
*
* @throws \Doctrine\ORM\Query\QueryException
*/
@@ -458,9 +484,10 @@ class Parser
}
/**
- * Peek beyond the matched closing parenthesis and return the first token after that one.
+ * Peeks beyond the matched closing parenthesis and returns the first token after that one.
+ *
+ * @param boolean $resetPeek Reset peek after finding the closing parenthesis.
*
- * @param boolean $resetPeek Reset peek after finding the closing parenthesis
* @return array
*/
private function peekBeyondClosingParenthesis($resetPeek = true)
@@ -495,6 +522,8 @@ class Parser
/**
* Checks if the given token indicates a mathematical operator.
*
+ * @param array $token
+ *
* @return boolean TRUE if the token is a mathematical operator, FALSE otherwise.
*/
private function isMathOperator($token)
@@ -520,6 +549,8 @@ class Parser
/**
* Checks whether the given token type indicates an aggregate function.
*
+ * @param int $tokenType
+ *
* @return boolean TRUE if the token type is an aggregate function, FALSE otherwise.
*/
private function isAggregateFunction($tokenType)
@@ -577,6 +608,7 @@ class Parser
* Validates that the given NewObjectExpression.
*
* @param \Doctrine\ORM\Query\AST\SelectClause $AST
+ *
* @return void
*/
private function processDeferredNewObjectExpressions($AST)
@@ -697,8 +729,9 @@ class Parser
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
* CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
*
- * @param array $deferredItem
* @param mixed $AST
+ *
+ * @return void
*/
private function processDeferredPathExpressions($AST)
{
@@ -766,6 +799,9 @@ class Parser
}
}
+ /**
+ * @return void
+ */
private function processRootEntityAliasSelected()
{
if ( ! count($this->identVariableExpressions)) {
@@ -1010,6 +1046,7 @@ class Parser
* PathExpression ::= IdentificationVariable "." identifier
*
* @param integer $expectedTypes
+ *
* @return \Doctrine\ORM\Query\AST\PathExpression
*/
public function PathExpression($expectedTypes)
@@ -1473,6 +1510,8 @@ class Parser
* NewValue ::= SimpleArithmeticExpression | "NULL"
*
* SimpleArithmeticExpression covers all *Primary grammar rules and also SimpleEntityExpression
+ *
+ * @return AST\ArithmeticExpression
*/
public function NewValue()
{
@@ -1950,7 +1989,7 @@ class Parser
/**
* GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END"
*
- * @return \Doctrine\ORM\Query\AST\GeneralExpression
+ * @return \Doctrine\ORM\Query\AST\GeneralCaseExpression
*/
public function GeneralCaseExpression()
{
@@ -1973,6 +2012,8 @@ class Parser
/**
* SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"
* CaseOperand ::= StateFieldPathExpression | TypeDiscriminator
+ *
+ * @return AST\SimpleCaseExpression
*/
public function SimpleCaseExpression()
{
@@ -1996,7 +2037,7 @@ class Parser
/**
* WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression
*
- * @return \Doctrine\ORM\Query\AST\WhenExpression
+ * @return \Doctrine\ORM\Query\AST\WhenClause
*/
public function WhenClause()
{
@@ -2010,7 +2051,7 @@ class Parser
/**
* SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression
*
- * @return \Doctrine\ORM\Query\AST\SimpleWhenExpression
+ * @return \Doctrine\ORM\Query\AST\SimpleWhenClause
*/
public function SimpleWhenClause()
{
@@ -3146,6 +3187,8 @@ class Parser
/**
* FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime
+ *
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
*/
public function FunctionDeclaration()
{
@@ -3169,7 +3212,9 @@ class Parser
}
/**
- * Helper function for FunctionDeclaration grammar rule
+ * Helper function for FunctionDeclaration grammar rule.
+ *
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
*/
private function CustomFunctionDeclaration()
{
@@ -3202,6 +3247,8 @@ class Parser
* "SQRT" "(" SimpleArithmeticExpression ")" |
* "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" |
* "SIZE" "(" CollectionValuedPathExpression ")"
+ *
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
*/
public function FunctionsReturningNumerics()
{
@@ -3214,6 +3261,9 @@ class Parser
return $function;
}
+ /**
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
+ */
public function CustomFunctionsReturningNumerics()
{
// getCustomNumericFunction is case-insensitive
@@ -3228,6 +3278,8 @@ class Parser
/**
* FunctionsReturningDateTime ::= "CURRENT_DATE" | "CURRENT_TIME" | "CURRENT_TIMESTAMP"
+ *
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
*/
public function FunctionsReturningDatetime()
{
@@ -3240,6 +3292,9 @@ class Parser
return $function;
}
+ /**
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
+ */
public function CustomFunctionsReturningDatetime()
{
// getCustomDatetimeFunction is case-insensitive
@@ -3259,6 +3314,8 @@ class Parser
* "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" |
* "LOWER" "(" StringPrimary ")" |
* "UPPER" "(" StringPrimary ")"
+ *
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
*/
public function FunctionsReturningStrings()
{
@@ -3271,6 +3328,9 @@ class Parser
return $function;
}
+ /**
+ * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode
+ */
public function CustomFunctionsReturningStrings()
{
// getCustomStringFunction is case-insensitive
diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php
index e068622de..dfd7dd2c9 100644
--- a/lib/Doctrine/ORM/Query/ParserResult.php
+++ b/lib/Doctrine/ORM/Query/ParserResult.php
@@ -65,8 +65,8 @@ class ParserResult
/**
* Gets the ResultSetMapping for the parsed query.
*
- * @return ResultSetMapping The result set mapping of the parsed query or NULL
- * if the query is not a SELECT query.
+ * @return ResultSetMapping|null The result set mapping of the parsed query or NULL
+ * if the query is not a SELECT query.
*/
public function getResultSetMapping()
{
@@ -77,6 +77,8 @@ class ParserResult
* Sets the ResultSetMapping of the parsed query.
*
* @param ResultSetMapping $rsm
+ *
+ * @return void
*/
public function setResultSetMapping(ResultSetMapping $rsm)
{
@@ -87,6 +89,8 @@ class ParserResult
* Sets the SQL executor that should be used for this ParserResult.
*
* @param \Doctrine\ORM\Query\Exec\AbstractSqlExecutor $executor
+ *
+ * @return void
*/
public function setSqlExecutor($executor)
{
@@ -108,7 +112,9 @@ class ParserResult
* several SQL parameter positions.
*
* @param string|integer $dqlPosition
- * @param integer $sqlPosition
+ * @param integer $sqlPosition
+ *
+ * @return void
*/
public function addParameterMapping($dqlPosition, $sqlPosition)
{
@@ -129,6 +135,7 @@ class ParserResult
* Gets the SQL parameter positions for a DQL parameter name/position.
*
* @param string|integer $dqlPosition The name or position of the DQL parameter.
+ *
* @return array The positions of the corresponding SQL parameters.
*/
public function getSqlParameterPositions($dqlPosition)
diff --git a/lib/Doctrine/ORM/Query/Printer.php b/lib/Doctrine/ORM/Query/Printer.php
index 83640c5d7..ffb457538 100644
--- a/lib/Doctrine/ORM/Query/Printer.php
+++ b/lib/Doctrine/ORM/Query/Printer.php
@@ -59,7 +59,9 @@ class Printer
*
* This method is called before executing a production.
*
- * @param string $name production name
+ * @param string $name Production name.
+ *
+ * @return void
*/
public function startProduction($name)
{
@@ -71,6 +73,8 @@ class Printer
* Decreases indentation level by one and prints a closing parenthesis.
*
* This method is called after executing a production.
+ *
+ * @return void
*/
public function endProduction()
{
@@ -81,7 +85,9 @@ class Printer
/**
* Prints text indented with spaces depending on current indentation level.
*
- * @param string $str text
+ * @param string $str The text.
+ *
+ * @return void
*/
public function println($str)
{
diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php
index a439991f9..06a622644 100644
--- a/lib/Doctrine/ORM/Query/QueryException.php
+++ b/lib/Doctrine/ORM/Query/QueryException.php
@@ -19,12 +19,9 @@
namespace Doctrine\ORM\Query;
-use Doctrine\ORM\Query\AST\PathExpression;
-
/**
- * Description of QueryException
+ * Description of QueryException.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Guilherme Blanco
@@ -34,56 +31,108 @@ use Doctrine\ORM\Query\AST\PathExpression;
*/
class QueryException extends \Doctrine\ORM\ORMException
{
+ /**
+ * @param string $dql
+ *
+ * @return QueryException
+ */
public static function dqlError($dql)
{
return new self($dql);
}
+ /**
+ * @param string $message
+ * @param \Exception|null $previous
+ *
+ * @return QueryException
+ */
public static function syntaxError($message, $previous = null)
{
return new self('[Syntax Error] ' . $message, 0, $previous);
}
+ /**
+ * @param string $message
+ * @param \Exception|null $previous
+ *
+ * @return QueryException
+ */
public static function semanticalError($message, $previous = null)
{
return new self('[Semantical Error] ' . $message, 0, $previous);
}
+ /**
+ * @return QueryException
+ */
public static function invalidLockMode()
{
return new self('Invalid lock mode hint provided.');
}
+ /**
+ * @param string $expected
+ * @param string $received
+ *
+ * @return QueryException
+ */
public static function invalidParameterType($expected, $received)
{
return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.');
}
+ /**
+ * @param string $pos
+ *
+ * @return QueryException
+ */
public static function invalidParameterPosition($pos)
{
return new self('Invalid parameter position: ' . $pos);
}
+ /**
+ * @return QueryException
+ */
public static function invalidParameterNumber()
{
return new self("Invalid parameter number: number of bound variables does not match number of tokens");
}
+ /**
+ * @param string $value
+ *
+ * @return QueryException
+ */
public static function invalidParameterFormat($value)
{
return new self('Invalid parameter format, '.$value.' given, but : or ? expected.');
}
+ /**
+ * @param string $key
+ *
+ * @return QueryException
+ */
public static function unknownParameter($key)
{
return new self("Invalid parameter: token ".$key." is not defined in the query.");
}
+ /**
+ * @return QueryException
+ */
public static function parameterTypeMissmatch()
{
return new self("DQL Query parameter and type numbers missmatch, but have to be exactly equal.");
}
+ /**
+ * @param object $pathExpr
+ *
+ * @return QueryException
+ */
public static function invalidPathExpression($pathExpr)
{
return new self(
@@ -91,12 +140,20 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
- public static function invalidLiteral($literal) {
+ /**
+ * @param string $literal
+ *
+ * @return QueryException
+ */
+ public static function invalidLiteral($literal)
+ {
return new self("Invalid literal '$literal'");
}
/**
* @param array $assoc
+ *
+ * @return QueryException
*/
public static function iterateWithFetchJoinCollectionNotAllowed($assoc)
{
@@ -106,6 +163,9 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @return QueryException
+ */
public static function partialObjectsAreDangerous()
{
return new self(
@@ -115,6 +175,11 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param array $assoc
+ *
+ * @return QueryException
+ */
public static function overwritingJoinConditionsNotYetSupported($assoc)
{
return new self(
@@ -124,6 +189,9 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @return QueryException
+ */
public static function associationPathInverseSideNotSupported()
{
return new self(
@@ -132,13 +200,22 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
- public static function iterateWithFetchJoinNotAllowed($assoc) {
+ /**
+ * @param array $assoc
+ *
+ * @return QueryException
+ */
+ public static function iterateWithFetchJoinNotAllowed($assoc)
+ {
return new self(
"Iterate with fetch join in class " . $assoc['sourceEntity'] .
" using association " . $assoc['fieldName'] . " not allowed."
);
}
+ /**
+ * @return QueryException
+ */
public static function associationPathCompositeKeyNotSupported()
{
return new self(
@@ -148,12 +225,23 @@ class QueryException extends \Doctrine\ORM\ORMException
);
}
+ /**
+ * @param string $className
+ * @param string $rootClass
+ *
+ * @return QueryException
+ */
public static function instanceOfUnrelatedClass($className, $rootClass)
{
return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " .
"inheritance hierachy exists between these two classes.");
}
+ /**
+ * @param string $dqlAlias
+ *
+ * @return QueryException
+ */
public static function invalidQueryComponent($dqlAlias)
{
return new self(
diff --git a/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php b/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php
index 6f16a3515..775d70019 100644
--- a/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php
+++ b/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php
@@ -30,13 +30,16 @@ use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Query\Parameter;
/**
- * Convert Collection expressions to Query expressions
+ * Converts Collection expressions to Query expressions.
*
* @author Kirill chEbba Chebunin
* @since 2.4
*/
class QueryExpressionVisitor extends ExpressionVisitor
{
+ /**
+ * @var array
+ */
private static $operatorMap = array(
Comparison::GT => Expr\Comparison::GT,
Comparison::GTE => Expr\Comparison::GTE,
@@ -44,11 +47,18 @@ class QueryExpressionVisitor extends ExpressionVisitor
Comparison::LTE => Expr\Comparison::LTE
);
+ /**
+ * @var Expr
+ */
private $expr;
+
+ /**
+ * @var array
+ */
private $parameters = array();
/**
- * Constructor with internal initialization
+ * Constructor with internal initialization.
*/
public function __construct()
{
@@ -56,7 +66,7 @@ class QueryExpressionVisitor extends ExpressionVisitor
}
/**
- * Get bound parameters.
+ * Gets bound parameters.
* Filled after {@link dispach()}.
*
* @return \Doctrine\Common\Collections\Collection
@@ -67,7 +77,9 @@ class QueryExpressionVisitor extends ExpressionVisitor
}
/**
- * Clear parameters
+ * Clears parameters.
+ *
+ * @return void
*/
public function clearParameters()
{
@@ -75,7 +87,7 @@ class QueryExpressionVisitor extends ExpressionVisitor
}
/**
- * Convert Criteria expression to Query one based on static map.
+ * Converts Criteria expression to Query one based on static map.
*
* @param string $criteriaOperator
*
@@ -155,7 +167,6 @@ class QueryExpressionVisitor extends ExpressionVisitor
throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
}
-
}
/**
diff --git a/lib/Doctrine/ORM/Query/ResultSetMapping.php b/lib/Doctrine/ORM/Query/ResultSetMapping.php
index 35505bf5c..9dbe9bc63 100644
--- a/lib/Doctrine/ORM/Query/ResultSetMapping.php
+++ b/lib/Doctrine/ORM/Query/ResultSetMapping.php
@@ -36,102 +36,134 @@ namespace Doctrine\ORM\Query;
class ResultSetMapping
{
/**
+ * Whether the result is mixed (contains scalar values together with field values).
+ *
* @ignore
- * @var boolean Whether the result is mixed (contains scalar values together with field values).
+ * @var boolean
*/
public $isMixed = false;
/**
+ * Maps alias names to class names.
+ *
* @ignore
- * @var array Maps alias names to class names.
+ * @var array
*/
public $aliasMap = array();
/**
+ * Maps alias names to related association field names.
+ *
* @ignore
- * @var array Maps alias names to related association field names.
+ * @var array
*/
public $relationMap = array();
/**
+ * Maps alias names to parent alias names.
+ *
* @ignore
- * @var array Maps alias names to parent alias names.
+ * @var array
*/
public $parentAliasMap = array();
/**
+ * Maps column names in the result set to field names for each class.
+ *
* @ignore
- * @var array Maps column names in the result set to field names for each class.
+ * @var array
*/
public $fieldMappings = array();
/**
+ * Maps column names in the result set to the alias/field name to use in the mapped result.
+ *
* @ignore
- * @var array Maps column names in the result set to the alias/field name to use in the mapped result.
+ * @var array
*/
public $scalarMappings = array();
/**
+ * Maps column names in the result set to the alias/field type to use in the mapped result.
+ *
* @ignore
- * @var array Maps column names in the result set to the alias/field type to use in the mapped result.
+ * @var array
*/
public $typeMappings = array();
/**
+ * Maps entities in the result set to the alias name to use in the mapped result.
+ *
* @ignore
- * @var array Maps entities in the result set to the alias name to use in the mapped result.
+ * @var array
*/
public $entityMappings = array();
/**
+ * Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names.
+ *
* @ignore
- * @var array Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names.
+ * @var array
*/
public $metaMappings = array();
/**
+ * Maps column names in the result set to the alias they belong to.
+ *
* @ignore
- * @var array Maps column names in the result set to the alias they belong to.
+ * @var array
*/
public $columnOwnerMap = array();
/**
+ * List of columns in the result set that are used as discriminator columns.
+ *
* @ignore
- * @var array List of columns in the result set that are used as discriminator columns.
+ * @var array
*/
public $discriminatorColumns = array();
/**
+ * Maps alias names to field names that should be used for indexing.
+ *
* @ignore
- * @var array Maps alias names to field names that should be used for indexing.
+ * @var array
*/
public $indexByMap = array();
/**
+ * Map from column names to class names that declare the field the column is mapped to.
+ *
* @ignore
- * @var array Map from column names to class names that declare the field the column is mapped to.
+ * @var array
*/
public $declaringClasses = array();
/**
- * @var array This is necessary to hydrate derivate foreign keys correctly.
+ * This is necessary to hydrate derivate foreign keys correctly.
+ *
+ * @var array
*/
public $isIdentifierColumn = array();
/**
- * @var array Maps column names in the result set to field names for each new object expression.
+ * Maps column names in the result set to field names for each new object expression.
+ *
+ * @var array
*/
public $newObjectMappings = array();
/**
* Adds an entity result to this ResultSetMapping.
*
- * @param string $class The class name of the entity.
- * @param string $alias The alias for the class. The alias must be unique among all entity
- * results or joined entity results within this ResultSetMapping.
- * @param string $resultAlias The result alias with which the entity result should be
- * placed in the result structure.
+ * @param string $class The class name of the entity.
+ * @param string $alias The alias for the class. The alias must be unique among all entity
+ * results or joined entity results within this ResultSetMapping.
+ * @param string|null $resultAlias The result alias with which the entity result should be
+ * placed in the result structure.
+ *
* @return ResultSetMapping This ResultSetMapping instance.
+ *
* @todo Rename: addRootEntity
*/
public function addEntityResult($class, $alias, $resultAlias = null)
@@ -151,10 +183,12 @@ class ResultSetMapping
* The discriminator column will be used to determine the concrete class name to
* instantiate.
*
- * @param string $alias The alias of the entity result or joined entity result the discriminator
- * column should be used for.
+ * @param string $alias The alias of the entity result or joined entity result the discriminator
+ * column should be used for.
* @param string $discrColumn The name of the discriminator column in the SQL result set.
+ *
* @return ResultSetMapping This ResultSetMapping instance.
+ *
* @todo Rename: addDiscriminatorColumn
*/
public function setDiscriminatorColumn($alias, $discrColumn)
@@ -168,8 +202,9 @@ class ResultSetMapping
/**
* Sets a field to use for indexing an entity result or joined entity result.
*
- * @param string $alias The alias of an entity result or joined entity result.
+ * @param string $alias The alias of an entity result or joined entity result.
* @param string $fieldName The name of the field to use for indexing.
+ *
* @return ResultSetMapping This ResultSetMapping instance.
*/
public function addIndexBy($alias, $fieldName)
@@ -201,9 +236,10 @@ class ResultSetMapping
}
/**
- * Set to index by a scalar result column name
+ * Sets to index by a scalar result column name.
+ *
+ * @param string $resultColumnName
*
- * @param $resultColumnName
* @return ResultSetMapping This ResultSetMapping instance.
*/
public function addIndexByScalar($resultColumnName)
@@ -216,8 +252,9 @@ class ResultSetMapping
/**
* Sets a column to use for indexing an entity or joined entity result by the given alias name.
*
- * @param $alias
- * @param $resultColumnName
+ * @param string $alias
+ * @param string $resultColumnName
+ *
* @return ResultSetMapping This ResultSetMapping instance.
*/
public function addIndexByColumn($alias, $resultColumnName)
@@ -232,7 +269,9 @@ class ResultSetMapping
* a field set for indexing.
*
* @param string $alias
+ *
* @return boolean
+ *
* @todo Rename: isIndexed($alias)
*/
public function hasIndexBy($alias)
@@ -245,7 +284,9 @@ class ResultSetMapping
* as part of an entity result or joined entity result.
*
* @param string $columnName The name of the column in the SQL result set.
+ *
* @return boolean
+ *
* @todo Rename: isField
*/
public function isFieldResult($columnName)
@@ -256,15 +297,17 @@ class ResultSetMapping
/**
* Adds a field to the result that belongs to an entity or joined entity.
*
- * @param string $alias The alias of the root entity or joined entity to which the field belongs.
- * @param string $columnName The name of the column in the SQL result set.
- * @param string $fieldName The name of the field on the declaring class.
- * @param string $declaringClass The name of the class that declares/owns the specified field.
- * When $alias refers to a superclass in a mapped hierarchy but
- * the field $fieldName is defined on a subclass, specify that here.
- * If not specified, the field is assumed to belong to the class
- * designated by $alias.
+ * @param string $alias The alias of the root entity or joined entity to which the field belongs.
+ * @param string $columnName The name of the column in the SQL result set.
+ * @param string $fieldName The name of the field on the declaring class.
+ * @param string|null $declaringClass The name of the class that declares/owns the specified field.
+ * When $alias refers to a superclass in a mapped hierarchy but
+ * the field $fieldName is defined on a subclass, specify that here.
+ * If not specified, the field is assumed to belong to the class
+ * designated by $alias.
+ *
* @return ResultSetMapping This ResultSetMapping instance.
+ *
* @todo Rename: addField
*/
public function addFieldResult($alias, $columnName, $fieldName, $declaringClass = null)
@@ -286,11 +329,14 @@ class ResultSetMapping
/**
* Adds a joined entity result.
*
- * @param string $class The class name of the joined entity.
- * @param string $alias The unique alias to use for the joined entity.
+ * @param string $class The class name of the joined entity.
+ * @param string $alias The unique alias to use for the joined entity.
* @param string $parentAlias The alias of the entity result that is the parent of this joined result.
- * @param object $relation The association field that connects the parent entity result with the joined entity result.
+ * @param object $relation The association field that connects the parent entity result
+ * with the joined entity result.
+ *
* @return ResultSetMapping This ResultSetMapping instance.
+ *
* @todo Rename: addJoinedEntity
*/
public function addJoinedEntityResult($class, $alias, $parentAlias, $relation)
@@ -306,8 +352,8 @@ class ResultSetMapping
* Adds a scalar result mapping.
*
* @param string $columnName The name of the column in the SQL result set.
- * @param string $alias The result alias with which the scalar result should be placed in the result structure.
- * @param string $type The column type
+ * @param string $alias The result alias with which the scalar result should be placed in the result structure.
+ * @param string $type The column type
*
* @return ResultSetMapping This ResultSetMapping instance.
*
@@ -328,8 +374,10 @@ class ResultSetMapping
/**
* Checks whether a column with a given name is mapped as a scalar result.
*
- * @param string $columName The name of the column in the SQL result set.
+ * @param string $columnName The name of the column in the SQL result set.
+ *
* @return boolean
+ *
* @todo Rename: isScalar
*/
public function isScalarResult($columnName)
@@ -342,6 +390,7 @@ class ResultSetMapping
* identified by the given unique alias.
*
* @param string $alias
+ *
* @return string
*/
public function getClassName($alias)
@@ -353,6 +402,7 @@ class ResultSetMapping
* Gets the field alias for a column that is mapped as a scalar value.
*
* @param string $columnName The name of the column in the SQL result set.
+ *
* @return string
*/
public function getScalarAlias($columnName)
@@ -364,6 +414,7 @@ class ResultSetMapping
* Gets the name of the class that owns a field mapping for the specified column.
*
* @param string $columnName
+ *
* @return string
*/
public function getDeclaringClass($columnName)
@@ -372,8 +423,8 @@ class ResultSetMapping
}
/**
- *
* @param string $alias
+ *
* @return AssociationMapping
*/
public function getRelation($alias)
@@ -382,8 +433,8 @@ class ResultSetMapping
}
/**
- *
* @param string $alias
+ *
* @return boolean
*/
public function isRelation($alias)
@@ -395,6 +446,7 @@ class ResultSetMapping
* Gets the alias of the class that owns a field mapping for the specified column.
*
* @param string $columnName
+ *
* @return string
*/
public function getEntityAlias($columnName)
@@ -406,6 +458,7 @@ class ResultSetMapping
* Gets the parent alias of the given alias.
*
* @param string $alias
+ *
* @return string
*/
public function getParentAlias($alias)
@@ -417,6 +470,7 @@ class ResultSetMapping
* Checks whether the given alias has a parent alias.
*
* @param string $alias
+ *
* @return boolean
*/
public function hasParentAlias($alias)
@@ -428,6 +482,7 @@ class ResultSetMapping
* Gets the field name for a column name.
*
* @param string $columnName
+ *
* @return string
*/
public function getFieldName($columnName)
@@ -436,7 +491,6 @@ class ResultSetMapping
}
/**
- *
* @return array
*/
public function getAliasMap()
@@ -456,6 +510,7 @@ class ResultSetMapping
/**
* Checks whether this ResultSetMapping defines a mixed result.
+ *
* Mixed results can only occur in object and array (graph) hydration. In such a
* case a mixed result means that scalar values are mixed with objects/array in
* the result.
@@ -473,7 +528,8 @@ class ResultSetMapping
* @param string $alias
* @param string $columnName
* @param string $fieldName
- * @param bool
+ * @param bool $isIdentifierColumn
+ *
* @return ResultSetMapping This ResultSetMapping instance.
*/
public function addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = false)
diff --git a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php
index c47ef6c9d..da7ce2565 100644
--- a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php
+++ b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php
@@ -23,7 +23,7 @@ use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
/**
- * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields
+ * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields.
*
* @author Michael Ridgway
* @since 2.1
@@ -37,7 +37,7 @@ class ResultSetMappingBuilder extends ResultSetMapping
*
* @var int
*/
- const COLUMN_RENAMING_NONE = 1;
+ const COLUMN_RENAMING_NONE = 1;
/**
* Picking custom renaming allows the user to define the renaming
@@ -46,7 +46,7 @@ class ResultSetMappingBuilder extends ResultSetMapping
*
* @var int
*/
- const COLUMN_RENAMING_CUSTOM = 2;
+ const COLUMN_RENAMING_CUSTOM = 2;
/**
* Incremental renaming uses a result set mapping internal counter to add a
@@ -77,7 +77,7 @@ class ResultSetMappingBuilder extends ResultSetMapping
/**
* @param EntityManager $em
- * @param integer $defaultRenameMode
+ * @param integer $defaultRenameMode
*/
public function __construct(EntityManager $em, $defaultRenameMode = self::COLUMN_RENAMING_NONE)
{
@@ -88,10 +88,12 @@ class ResultSetMappingBuilder extends ResultSetMapping
/**
* Adds a root entity and all of its fields to the result set.
*
- * @param string $class The class name of the root entity.
- * @param string $alias The unique alias to use for the root entity.
- * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName)
- * @param int $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM).
+ * @param string $class The class name of the root entity.
+ * @param string $alias The unique alias to use for the root entity.
+ * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName).
+ * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM).
+ *
+ * @return void
*/
public function addRootEntityFromClassMetadata($class, $alias, $renamedColumns = array(), $renameMode = null)
{
@@ -105,12 +107,15 @@ class ResultSetMappingBuilder extends ResultSetMapping
/**
* Adds a joined entity and all of its fields to the result set.
*
- * @param string $class The class name of the joined entity.
- * @param string $alias The unique alias to use for the joined entity.
- * @param string $parentAlias The alias of the entity result that is the parent of this joined result.
- * @param object $relation The association field that connects the parent entity result with the joined entity result.
- * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName)
- * @param int $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM).
+ * @param string $class The class name of the joined entity.
+ * @param string $alias The unique alias to use for the joined entity.
+ * @param string $parentAlias The alias of the entity result that is the parent of this joined result.
+ * @param object $relation The association field that connects the parent entity result
+ * with the joined entity result.
+ * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName).
+ * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM).
+ *
+ * @return void
*/
public function addJoinedEntityFromClassMetadata($class, $alias, $parentAlias, $relation, $renamedColumns = array(), $renameMode = null)
{
@@ -122,7 +127,15 @@ class ResultSetMappingBuilder extends ResultSetMapping
}
/**
- * Adds all fields of the given class to the result set mapping (columns and meta fields)
+ * Adds all fields of the given class to the result set mapping (columns and meta fields).
+ *
+ * @param string $class
+ * @param string $alias
+ * @param array $columnAliasMap
+ *
+ * @return void
+ *
+ * @throws \InvalidArgumentException
*/
protected function addAllClassFields($class, $alias, $columnAliasMap = array())
{
@@ -162,11 +175,11 @@ class ResultSetMappingBuilder extends ResultSetMapping
}
/**
- * Get column alias for a given column.
+ * Gets column alias for a given column.
*
* @param string $columnName
- * @param int $mode
- * @param array $customRenameColumns
+ * @param int $mode
+ * @param array $customRenameColumns
*
* @return string
*/
@@ -187,14 +200,13 @@ class ResultSetMappingBuilder extends ResultSetMapping
}
/**
- * Retrieve a class columns and join columns aliases that are used
- * in the SELECT clause.
+ * Retrieves a class columns and join columns aliases that are used in the SELECT clause.
*
* This depends on the renaming mode selected by the user.
*
* @param string $className
- * @param int $mode
- * @param array $customRenameColumns
+ * @param int $mode
+ * @param array $customRenameColumns
*
* @return array
*/
@@ -220,18 +232,16 @@ class ResultSetMappingBuilder extends ResultSetMapping
}
}
-
return $columnAlias;
}
-
-
/**
* Adds the mappings of the results of native SQL queries to the result set.
*
- * @param ClassMetadataInfo $class
- * @param array $queryMapping
- * @return ResultSetMappingBuilder
+ * @param ClassMetadataInfo $class
+ * @param array $queryMapping
+ *
+ * @return ResultSetMappingBuilder
*/
public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $queryMapping)
{
@@ -245,8 +255,9 @@ class ResultSetMappingBuilder extends ResultSetMapping
/**
* Adds the class mapping of the results of native SQL queries to the result set.
*
- * @param ClassMetadataInfo $class
- * @param string $resultClassName
+ * @param ClassMetadataInfo $class
+ * @param string $resultClassName
+ *
* @return ResultSetMappingBuilder
*/
public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, $resultClassName)
@@ -283,9 +294,10 @@ class ResultSetMappingBuilder extends ResultSetMapping
/**
* Adds the result set mapping of the results of native SQL queries to the result set.
*
- * @param ClassMetadataInfo $class
- * @param string $resultSetMappingName
- * @return ResultSetMappingBuilder
+ * @param ClassMetadataInfo $class
+ * @param string $resultSetMappingName
+ *
+ * @return ResultSetMappingBuilder
*/
public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $resultSetMappingName)
{
@@ -329,9 +341,12 @@ class ResultSetMappingBuilder extends ResultSetMapping
* Adds the entity result mapping of the results of native SQL queries to the result set.
*
* @param ClassMetadataInfo $classMetadata
- * @param array $entityMapping
- * @param string $alias
+ * @param array $entityMapping
+ * @param string $alias
+ *
* @return ResultSetMappingBuilder
+ *
+ * @throws \InvalidArgumentException
*/
public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classMetadata, array $entityMapping, $alias)
{
@@ -380,11 +395,13 @@ class ResultSetMappingBuilder extends ResultSetMapping
}
/**
- * Generate the Select clause from this ResultSetMappingBuilder
+ * Generates the Select clause from this ResultSetMappingBuilder.
*
* Works only for all the entity results. The select parts for scalar
* expressions have to be written manually.
*
+ * @param array $tableAliases
+ *
* @return string
*/
public function generateSelectClause($tableAliases = array())
@@ -416,6 +433,9 @@ class ResultSetMappingBuilder extends ResultSetMapping
return $sql;
}
+ /**
+ * @return string
+ */
public function __toString()
{
return $this->generateSelectClause(array());
diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php
index c21e0e91d..0e01d9c5b 100644
--- a/lib/Doctrine/ORM/Query/SqlWalker.php
+++ b/lib/Doctrine/ORM/Query/SqlWalker.php
@@ -51,35 +51,35 @@ class SqlWalker implements TreeWalker
private $rsm;
/**
- * Counters for generating unique column aliases.
+ * Counter for generating unique column aliases.
*
* @var integer
*/
private $aliasCounter = 0;
/**
- * Counters for generating unique table aliases.
+ * Counter for generating unique table aliases.
*
* @var integer
*/
private $tableAliasCounter = 0;
/**
- * Counters for generating unique scalar result.
+ * Counter for generating unique scalar result.
*
* @var integer
*/
private $scalarResultCounter = 1;
/**
- * Counters for generating unique parameter indexes.
+ * Counter for generating unique parameter indexes.
*
* @var integer
*/
private $sqlParamIndex = 0;
/**
- * Counters for generating indexes.
+ * Counter for generating indexes.
*
* @var integer
*/
@@ -91,7 +91,7 @@ class SqlWalker implements TreeWalker
private $parserResult;
/**
- * @var EntityManager
+ * @var \Doctrine\ORM\EntityManager
*/
private $em;
@@ -101,7 +101,7 @@ class SqlWalker implements TreeWalker
private $conn;
/**
- * @var AbstractQuery
+ * @var \Doctrine\ORM\AbstractQuery
*/
private $query;
@@ -118,7 +118,7 @@ class SqlWalker implements TreeWalker
private $scalarResultAliasMap = array();
/**
- * Map from DQL-Alias + Field-Name to SQL Column Alias
+ * Map from DQL-Alias + Field-Name to SQL Column Alias.
*
* @var array
*/
@@ -156,7 +156,7 @@ class SqlWalker implements TreeWalker
/**
* The database platform abstraction.
*
- * @var AbstractPlatform
+ * @var \Doctrine\DBAL\Platforms\AbstractPlatform
*/
private $platform;
@@ -195,7 +195,7 @@ class SqlWalker implements TreeWalker
/**
* Gets the Connection used by the walker.
*
- * @return Connection
+ * @return \Doctrine\DBAL\Connection
*/
public function getConnection()
{
@@ -205,7 +205,7 @@ class SqlWalker implements TreeWalker
/**
* Gets the EntityManager used by the walker.
*
- * @return EntityManager
+ * @return \Doctrine\ORM\EntityManager
*/
public function getEntityManager()
{
@@ -216,6 +216,7 @@ class SqlWalker implements TreeWalker
* Gets the information about a single query component.
*
* @param string $dqlAlias The DQL alias.
+ *
* @return array
*/
public function getQueryComponent($dqlAlias)
@@ -224,9 +225,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Return internal queryComponents array
- *
- * @return array
+ * {@inheritdoc}
*/
public function getQueryComponents()
{
@@ -234,10 +233,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Set or override a query component for a given dql alias.
- *
- * @param string $dqlAlias The DQL alias.
- * @param array $queryComponent
+ * {@inheritdoc}
*/
public function setQueryComponent($dqlAlias, array $queryComponent)
{
@@ -251,9 +247,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Gets an executor that can be used to execute the result of this walker.
- *
- * @return AbstractExecutor
+ * {@inheritdoc}
*/
public function getExecutor($AST)
{
@@ -281,7 +275,8 @@ class SqlWalker implements TreeWalker
* Generates a unique, short SQL table alias.
*
* @param string $tableName Table name
- * @param string $dqlAlias The DQL alias.
+ * @param string $dqlAlias The DQL alias.
+ *
* @return string Generated table alias.
*/
public function getSQLTableAlias($tableName, $dqlAlias = '')
@@ -302,6 +297,7 @@ class SqlWalker implements TreeWalker
* @param string $tableName
* @param string $alias
* @param string $dqlAlias
+ *
* @return string
*/
public function setSQLTableAlias($tableName, $alias, $dqlAlias = '')
@@ -317,6 +313,7 @@ class SqlWalker implements TreeWalker
* Gets an SQL column alias for a column name.
*
* @param string $columnName
+ *
* @return string
*/
public function getSQLColumnAlias($columnName)
@@ -328,8 +325,9 @@ class SqlWalker implements TreeWalker
* Generates the SQL JOINs that are necessary for Class Table Inheritance
* for the given class.
*
- * @param ClassMetadata $class The class for which to generate the joins.
- * @param string $dqlAlias The DQL alias of the class.
+ * @param ClassMetadata $class The class for which to generate the joins.
+ * @param string $dqlAlias The DQL alias of the class.
+ *
* @return string The SQL.
*/
private function _generateClassTableInheritanceJoins($class, $dqlAlias)
@@ -385,6 +383,9 @@ class SqlWalker implements TreeWalker
return $sql;
}
+ /**
+ * @return string
+ */
private function _generateOrderedCollectionOrderByItems()
{
$sqlParts = array();
@@ -412,6 +413,7 @@ class SqlWalker implements TreeWalker
* Generates a discriminator column SQL condition for the class with the given DQL alias.
*
* @param array $dqlAliases List of root DQL aliases to inspect for discriminator restrictions.
+ *
* @return string
*/
private function _generateDiscriminatorColumnConditionSQL(array $dqlAliases)
@@ -446,8 +448,8 @@ class SqlWalker implements TreeWalker
/**
* Generates the filter SQL for a given entity and table alias.
*
- * @param ClassMetadata $targetEntity Metadata of the target entity.
- * @param string $targetTableAlias The table alias of the joined/selected table.
+ * @param ClassMetadata $targetEntity Metadata of the target entity.
+ * @param string $targetTableAlias The table alias of the joined/selected table.
*
* @return string The SQL query part to add to a query.
*/
@@ -487,10 +489,9 @@ class SqlWalker implements TreeWalker
return implode(' AND ', $filterClauses);
}
+
/**
- * Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectStatement(AST\SelectStatement $AST)
{
@@ -539,10 +540,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateStatement(AST\UpdateStatement $AST)
{
@@ -553,10 +551,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkDeleteStatement(AST\DeleteStatement $AST)
{
@@ -571,6 +566,7 @@ class SqlWalker implements TreeWalker
* This one differs of ->walkIdentificationVariable() because it generates the entity identifiers.
*
* @param string $identVariable
+ *
* @return string
*/
public function walkEntityIdentificationVariable($identVariable)
@@ -591,6 +587,7 @@ class SqlWalker implements TreeWalker
*
* @param string $identificationVariable
* @param string $fieldName
+ *
* @return string The SQL.
*/
public function walkIdentificationVariable($identificationVariable, $fieldName = null)
@@ -608,10 +605,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a PathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkPathExpression($pathExpr)
{
@@ -667,10 +661,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- *
- * @param $selectClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectClause($selectClause)
{
@@ -775,9 +766,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a FromClause AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkFromClause($fromClause)
{
@@ -814,6 +803,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL.
*
+ * @param AST\RangeVariableDeclaration $rangeVariableDeclaration
+ *
* @return string
*/
public function walkRangeVariableDeclaration($rangeVariableDeclaration)
@@ -836,7 +827,12 @@ class SqlWalker implements TreeWalker
/**
* Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL.
*
+ * @param AST\JoinAssociationDeclaration $joinAssociationDeclaration
+ * @param int $joinType
+ *
* @return string
+ *
+ * @throws QueryException
*/
public function walkJoinAssociationDeclaration($joinAssociationDeclaration, $joinType = AST\Join::JOIN_TYPE_INNER)
{
@@ -973,9 +969,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkFunction($function)
{
@@ -983,10 +977,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkOrderByClause($orderByClause)
{
@@ -1000,10 +991,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkOrderByItem($orderByItem)
{
@@ -1016,10 +1004,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- *
- * @param HavingClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkHavingClause($havingClause)
{
@@ -1027,9 +1012,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a Join AST node and creates the corresponding SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkJoin($join)
{
@@ -1069,7 +1052,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a CaseExpression AST node and generates the corresponding SQL.
*
- * @param CoalesceExpression|NullIfExpression|GeneralCaseExpression|SimpleCaseExpression $expression
+ * @param AST\CoalesceExpression|AST\NullIfExpression|AST\GeneralCaseExpression|AST\SimpleCaseExpression $expression
+ *
* @return string The SQL.
*/
public function walkCaseExpression($expression)
@@ -1095,7 +1079,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a CoalesceExpression AST node and generates the corresponding SQL.
*
- * @param CoalesceExpression $coalesceExpression
+ * @param AST\CoalesceExpression $coalesceExpression
+ *
* @return string The SQL.
*/
public function walkCoalesceExpression($coalesceExpression)
@@ -1116,7 +1101,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a NullIfExpression AST node and generates the corresponding SQL.
*
- * @param NullIfExpression $nullIfExpression
+ * @param AST\NullIfExpression $nullIfExpression
+ *
* @return string The SQL.
*/
public function walkNullIfExpression($nullIfExpression)
@@ -1135,7 +1121,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a GeneralCaseExpression AST node and generates the corresponding SQL.
*
- * @param GeneralCaseExpression $generalCaseExpression
+ * @param AST\GeneralCaseExpression $generalCaseExpression
+ *
* @return string The SQL.
*/
public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression)
@@ -1155,7 +1142,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down a SimpleCaseExpression AST node and generates the corresponding SQL.
*
- * @param SimpleCaseExpression $simpleCaseExpression
+ * @param AST\SimpleCaseExpression $simpleCaseExpression
+ *
* @return string The SQL.
*/
public function walkSimpleCaseExpression($simpleCaseExpression)
@@ -1173,10 +1161,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a SelectExpression AST node and generates the corresponding SQL.
- *
- * @param SelectExpression $selectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectExpression($selectExpression)
{
@@ -1356,10 +1341,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- *
- * @param QuantifiedExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkQuantifiedExpression($qExpr)
{
@@ -1367,10 +1349,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a Subselect AST node, thereby generating the appropriate SQL.
- *
- * @param Subselect
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSubselect($subselect)
{
@@ -1395,10 +1374,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- *
- * @param SubselectFromClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSubselectFromClause($subselectFromClause)
{
@@ -1419,10 +1395,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleSelectClause($simpleSelectClause)
{
@@ -1431,7 +1404,8 @@ class SqlWalker implements TreeWalker
}
/**
- * @param AST\NewObjectExpression
+ * @param AST\NewObjectExpression $newObjectExpression
+ *
* @return string The SQL.
*/
public function walkNewObject($newObjectExpression)
@@ -1493,10 +1467,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleSelectExpression($simpleSelectExpression)
{
@@ -1549,10 +1520,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- *
- * @param AggregateExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkAggregateExpression($aggExpression)
{
@@ -1561,10 +1529,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkGroupByClause($groupByClause)
{
@@ -1578,10 +1543,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkGroupByItem($groupByItem)
{
@@ -1618,10 +1580,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkDeleteClause(AST\DeleteClause $deleteClause)
{
@@ -1636,10 +1595,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateClause($updateClause)
{
@@ -1656,10 +1612,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateItem($updateItem)
{
@@ -1689,11 +1642,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a WhereClause AST node, thereby generating the appropriate SQL.
- * WhereClause or not, the appropriate discriminator sql is added.
- *
- * @param WhereClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkWhereClause($whereClause)
{
@@ -1732,10 +1681,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalExpression($condExpr)
{
@@ -1749,10 +1695,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalTerm
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalTerm($condTerm)
{
@@ -1766,10 +1709,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalFactor
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalFactor($factor)
{
@@ -1781,10 +1721,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalPrimary
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalPrimary($primary)
{
@@ -1800,10 +1737,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ExistsExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkExistsExpression($existsExpr)
{
@@ -1815,10 +1749,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- *
- * @param CollectionMemberExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkCollectionMemberExpression($collMemberExpr)
{
@@ -1928,10 +1859,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param EmptyCollectionComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
{
@@ -1942,10 +1870,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param NullComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkNullComparisonExpression($nullCompExpr)
{
@@ -1966,10 +1891,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an InExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInExpression($inExpr)
{
@@ -1985,10 +1907,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InstanceOfExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInstanceOfExpression($instanceOfExpr)
{
@@ -2045,10 +1964,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an InParameter AST node, thereby generating the appropriate SQL.
- *
- * @param InParameter
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInParameter($inParam)
{
@@ -2058,10 +1974,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkLiteral($literal)
{
@@ -2084,10 +1997,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- *
- * @param BetweenExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkBetweenExpression($betweenExpr)
{
@@ -2102,10 +2012,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- *
- * @param LikeExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkLikeExpression($likeExpr)
{
@@ -2133,10 +2040,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param StateFieldPathExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkStateFieldPathExpression($stateFieldPathExpression)
{
@@ -2144,10 +2048,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkComparisonExpression($compExpr)
{
@@ -2169,10 +2070,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- *
- * @param InputParameter
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInputParameter($inputParam)
{
@@ -2182,10 +2080,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticExpression($arithmeticExpr)
{
@@ -2195,10 +2090,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
{
@@ -2210,10 +2102,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticTerm($term)
{
@@ -2233,10 +2122,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticFactor($factor)
{
@@ -2258,7 +2144,8 @@ class SqlWalker implements TreeWalker
/**
* Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL.
*
- * @param mixed
+ * @param mixed $primary
+ *
* @return string The SQL.
*/
public function walkArithmeticPrimary($primary)
@@ -2275,10 +2162,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkStringPrimary($stringPrimary)
{
@@ -2288,10 +2172,7 @@ class SqlWalker implements TreeWalker
}
/**
- * Walks down a ResultVriable that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param string $resultVariable
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkResultVariable($resultVariable)
{
diff --git a/lib/Doctrine/ORM/Query/TreeWalker.php b/lib/Doctrine/ORM/Query/TreeWalker.php
index ceb117c0a..9ddd86b04 100644
--- a/lib/Doctrine/ORM/Query/TreeWalker.php
+++ b/lib/Doctrine/ORM/Query/TreeWalker.php
@@ -28,32 +28,36 @@ namespace Doctrine\ORM\Query;
interface TreeWalker
{
/**
- * Initializes TreeWalker with important information about the ASTs to be walked
+ * Initializes TreeWalker with important information about the ASTs to be walked.
*
- * @param Query $query The parsed Query.
- * @param ParserResult $parserResult The result of the parsing process.
- * @param array $queryComponents Query components (symbol table)
+ * @param \Doctrine\ORM\AbstractQuery $query The parsed Query.
+ * @param \Doctrine\ORM\Query\ParserResult $parserResult The result of the parsing process.
+ * @param array $queryComponents The query components (symbol table).
*/
public function __construct($query, $parserResult, array $queryComponents);
- /**
- * Return internal queryComponents array
- *
- * @return array
- */
- public function getQueryComponents();
-
- /**
- * Set or override a query component for a given dql alias.
- *
- * @param string $dqlAlias The DQL alias.
- * @param array $queryComponent
- */
- public function setQueryComponent($dqlAlias, array $queryComponent);
+ /**
+ * Returns internal queryComponents array.
+ *
+ * @return array
+ */
+ public function getQueryComponents();
+
+ /**
+ * Sets or overrides a query component for a given dql alias.
+ *
+ * @param string $dqlAlias The DQL alias.
+ * @param array $queryComponent
+ *
+ * @return void
+ */
+ public function setQueryComponent($dqlAlias, array $queryComponent);
/**
* Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
*
+ * @param AST\SelectStatement $AST
+ *
* @return string The SQL.
*/
function walkSelectStatement(AST\SelectStatement $AST);
@@ -61,6 +65,8 @@ interface TreeWalker
/**
* Walks down a SelectClause AST node, thereby generating the appropriate SQL.
*
+ * @param AST\SelectClause $selectClause
+ *
* @return string The SQL.
*/
function walkSelectClause($selectClause);
@@ -68,6 +74,8 @@ interface TreeWalker
/**
* Walks down a FromClause AST node, thereby generating the appropriate SQL.
*
+ * @param AST\FromClause $fromClause
+ *
* @return string The SQL.
*/
function walkFromClause($fromClause);
@@ -75,6 +83,8 @@ interface TreeWalker
/**
* Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
*
+ * @param AST\Functions\FunctionNode $function
+ *
* @return string The SQL.
*/
function walkFunction($function);
@@ -82,7 +92,8 @@ interface TreeWalker
/**
* Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
*
- * @param OrderByClause
+ * @param AST\OrderByClause $orderByClause
+ *
* @return string The SQL.
*/
function walkOrderByClause($orderByClause);
@@ -90,7 +101,8 @@ interface TreeWalker
/**
* Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
*
- * @param OrderByItem
+ * @param AST\OrderByItem $orderByItem
+ *
* @return string The SQL.
*/
function walkOrderByItem($orderByItem);
@@ -98,7 +110,8 @@ interface TreeWalker
/**
* Walks down a HavingClause AST node, thereby generating the appropriate SQL.
*
- * @param HavingClause
+ * @param AST\HavingClause $havingClause
+ *
* @return string The SQL.
*/
function walkHavingClause($havingClause);
@@ -106,7 +119,8 @@ interface TreeWalker
/**
* Walks down a Join AST node and creates the corresponding SQL.
*
- * @param Join $joinVarDecl
+ * @param AST\Join $join
+ *
* @return string The SQL.
*/
function walkJoin($join);
@@ -114,7 +128,8 @@ interface TreeWalker
/**
* Walks down a SelectExpression AST node and generates the corresponding SQL.
*
- * @param SelectExpression $selectExpression
+ * @param AST\SelectExpression $selectExpression
+ *
* @return string The SQL.
*/
function walkSelectExpression($selectExpression);
@@ -122,7 +137,8 @@ interface TreeWalker
/**
* Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
*
- * @param QuantifiedExpression
+ * @param AST\QuantifiedExpression $qExpr
+ *
* @return string The SQL.
*/
function walkQuantifiedExpression($qExpr);
@@ -130,7 +146,8 @@ interface TreeWalker
/**
* Walks down a Subselect AST node, thereby generating the appropriate SQL.
*
- * @param Subselect
+ * @param AST\Subselect $subselect
+ *
* @return string The SQL.
*/
function walkSubselect($subselect);
@@ -138,7 +155,8 @@ interface TreeWalker
/**
* Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
*
- * @param SubselectFromClause
+ * @param AST\SubselectFromClause $subselectFromClause
+ *
* @return string The SQL.
*/
function walkSubselectFromClause($subselectFromClause);
@@ -146,7 +164,8 @@ interface TreeWalker
/**
* Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
*
- * @param SimpleSelectClause
+ * @param AST\SimpleSelectClause $simpleSelectClause
+ *
* @return string The SQL.
*/
function walkSimpleSelectClause($simpleSelectClause);
@@ -154,7 +173,8 @@ interface TreeWalker
/**
* Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
*
- * @param SimpleSelectExpression
+ * @param AST\SimpleSelectExpression $simpleSelectExpression
+ *
* @return string The SQL.
*/
function walkSimpleSelectExpression($simpleSelectExpression);
@@ -162,7 +182,8 @@ interface TreeWalker
/**
* Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
*
- * @param AggregateExpression
+ * @param AST\AggregateExpression $aggExpression
+ *
* @return string The SQL.
*/
function walkAggregateExpression($aggExpression);
@@ -170,7 +191,8 @@ interface TreeWalker
/**
* Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
*
- * @param GroupByClause
+ * @param AST\GroupByClause $groupByClause
+ *
* @return string The SQL.
*/
function walkGroupByClause($groupByClause);
@@ -178,7 +200,8 @@ interface TreeWalker
/**
* Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
*
- * @param GroupByItem
+ * @param AST\PathExpression|string $groupByItem
+ *
* @return string The SQL.
*/
function walkGroupByItem($groupByItem);
@@ -186,7 +209,8 @@ interface TreeWalker
/**
* Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
*
- * @param UpdateStatement
+ * @param AST\UpdateStatement $AST
+ *
* @return string The SQL.
*/
function walkUpdateStatement(AST\UpdateStatement $AST);
@@ -194,7 +218,8 @@ interface TreeWalker
/**
* Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
*
- * @param DeleteStatement
+ * @param AST\DeleteStatement $AST
+ *
* @return string The SQL.
*/
function walkDeleteStatement(AST\DeleteStatement $AST);
@@ -202,7 +227,8 @@ interface TreeWalker
/**
* Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
*
- * @param DeleteClause
+ * @param AST\DeleteClause $deleteClause
+ *
* @return string The SQL.
*/
function walkDeleteClause(AST\DeleteClause $deleteClause);
@@ -210,7 +236,8 @@ interface TreeWalker
/**
* Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
*
- * @param UpdateClause
+ * @param AST\UpdateClause $updateClause
+ *
* @return string The SQL.
*/
function walkUpdateClause($updateClause);
@@ -218,23 +245,27 @@ interface TreeWalker
/**
* Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
*
- * @param UpdateItem
+ * @param AST\UpdateItem $updateItem
+ *
* @return string The SQL.
*/
function walkUpdateItem($updateItem);
/**
* Walks down a WhereClause AST node, thereby generating the appropriate SQL.
+ * WhereClause or not, the appropriate discriminator sql is added.
+ *
+ * @param AST\WhereClause $whereClause
*
- * @param WhereClause
* @return string The SQL.
*/
function walkWhereClause($whereClause);
/**
- * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL.
+ * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
+ *
+ * @param AST\ConditionalExpression $condExpr
*
- * @param ConditionalExpression
* @return string The SQL.
*/
function walkConditionalExpression($condExpr);
@@ -242,7 +273,8 @@ interface TreeWalker
/**
* Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
*
- * @param ConditionalTerm
+ * @param AST\ConditionalTerm $condTerm
+ *
* @return string The SQL.
*/
function walkConditionalTerm($condTerm);
@@ -250,7 +282,8 @@ interface TreeWalker
/**
* Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
*
- * @param ConditionalFactor
+ * @param AST\ConditionalFactor $factor
+ *
* @return string The SQL.
*/
function walkConditionalFactor($factor);
@@ -258,7 +291,8 @@ interface TreeWalker
/**
* Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
*
- * @param ConditionalPrimary
+ * @param AST\ConditionalPrimary $primary
+ *
* @return string The SQL.
*/
function walkConditionalPrimary($primary);
@@ -266,7 +300,8 @@ interface TreeWalker
/**
* Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
*
- * @param ExistsExpression
+ * @param AST\ExistsExpression $existsExpr
+ *
* @return string The SQL.
*/
function walkExistsExpression($existsExpr);
@@ -274,7 +309,8 @@ interface TreeWalker
/**
* Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
*
- * @param CollectionMemberExpression
+ * @param AST\CollectionMemberExpression $collMemberExpr
+ *
* @return string The SQL.
*/
function walkCollectionMemberExpression($collMemberExpr);
@@ -282,7 +318,8 @@ interface TreeWalker
/**
* Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
*
- * @param EmptyCollectionComparisonExpression
+ * @param AST\EmptyCollectionComparisonExpression $emptyCollCompExpr
+ *
* @return string The SQL.
*/
function walkEmptyCollectionComparisonExpression($emptyCollCompExpr);
@@ -290,7 +327,8 @@ interface TreeWalker
/**
* Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
*
- * @param NullComparisonExpression
+ * @param AST\NullComparisonExpression $nullCompExpr
+ *
* @return string The SQL.
*/
function walkNullComparisonExpression($nullCompExpr);
@@ -298,7 +336,8 @@ interface TreeWalker
/**
* Walks down an InExpression AST node, thereby generating the appropriate SQL.
*
- * @param InExpression
+ * @param AST\InExpression $inExpr
+ *
* @return string The SQL.
*/
function walkInExpression($inExpr);
@@ -306,7 +345,8 @@ interface TreeWalker
/**
* Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
*
- * @param InstanceOfExpression
+ * @param AST\InstanceOfExpression $instanceOfExpr
+ *
* @return string The SQL.
*/
function walkInstanceOfExpression($instanceOfExpr);
@@ -314,7 +354,8 @@ interface TreeWalker
/**
* Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
*
- * @param mixed
+ * @param mixed $literal
+ *
* @return string The SQL.
*/
function walkLiteral($literal);
@@ -322,7 +363,8 @@ interface TreeWalker
/**
* Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
*
- * @param BetweenExpression
+ * @param AST\BetweenExpression $betweenExpr
+ *
* @return string The SQL.
*/
function walkBetweenExpression($betweenExpr);
@@ -330,7 +372,8 @@ interface TreeWalker
/**
* Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
*
- * @param LikeExpression
+ * @param AST\LikeExpression $likeExpr
+ *
* @return string The SQL.
*/
function walkLikeExpression($likeExpr);
@@ -338,7 +381,8 @@ interface TreeWalker
/**
* Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
*
- * @param StateFieldPathExpression
+ * @param AST\PathExpression $stateFieldPathExpression
+ *
* @return string The SQL.
*/
function walkStateFieldPathExpression($stateFieldPathExpression);
@@ -346,7 +390,8 @@ interface TreeWalker
/**
* Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
*
- * @param ComparisonExpression
+ * @param AST\ComparisonExpression $compExpr
+ *
* @return string The SQL.
*/
function walkComparisonExpression($compExpr);
@@ -354,7 +399,8 @@ interface TreeWalker
/**
* Walks down an InputParameter AST node, thereby generating the appropriate SQL.
*
- * @param InputParameter
+ * @param AST\InputParameter $inputParam
+ *
* @return string The SQL.
*/
function walkInputParameter($inputParam);
@@ -362,7 +408,8 @@ interface TreeWalker
/**
* Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
*
- * @param ArithmeticExpression
+ * @param AST\ArithmeticExpression $arithmeticExpr
+ *
* @return string The SQL.
*/
function walkArithmeticExpression($arithmeticExpr);
@@ -370,7 +417,8 @@ interface TreeWalker
/**
* Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
*
- * @param mixed
+ * @param mixed $term
+ *
* @return string The SQL.
*/
function walkArithmeticTerm($term);
@@ -378,7 +426,8 @@ interface TreeWalker
/**
* Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
*
- * @param mixed
+ * @param mixed $stringPrimary
+ *
* @return string The SQL.
*/
function walkStringPrimary($stringPrimary);
@@ -386,7 +435,8 @@ interface TreeWalker
/**
* Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
*
- * @param mixed
+ * @param mixed $factor
+ *
* @return string The SQL.
*/
function walkArithmeticFactor($factor);
@@ -394,23 +444,26 @@ interface TreeWalker
/**
* Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
*
- * @param SimpleArithmeticExpression
+ * @param AST\SimpleArithmeticExpression $simpleArithmeticExpr
+ *
* @return string The SQL.
*/
function walkSimpleArithmeticExpression($simpleArithmeticExpr);
/**
- * Walks down an PathExpression AST node, thereby generating the appropriate SQL.
+ * Walks down a PathExpression AST node, thereby generating the appropriate SQL.
+ *
+ * @param mixed $pathExpr
*
- * @param mixed
* @return string The SQL.
*/
function walkPathExpression($pathExpr);
/**
- * Walks down an ResultVariable AST node, thereby generating the appropriate SQL.
+ * Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.
*
* @param string $resultVariable
+ *
* @return string The SQL.
*/
function walkResultVariable($resultVariable);
@@ -418,7 +471,9 @@ interface TreeWalker
/**
* Gets an executor that can be used to execute the result of this walker.
*
- * @return AbstractExecutor
+ * @param AST\DeleteStatement|AST\UpdateStatement|AST\SelectStatement $AST
+ *
+ * @return Exec\AbstractSqlExecutor
*/
function getExecutor($AST);
}
diff --git a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php
index 32009a3c4..c285739d8 100644
--- a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php
+++ b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php
@@ -28,8 +28,25 @@ namespace Doctrine\ORM\Query;
*/
abstract class TreeWalkerAdapter implements TreeWalker
{
+ /**
+ * The original Query.
+ *
+ * @var \Doctrine\ORM\AbstractQuery
+ */
private $_query;
+
+ /**
+ * The ParserResult of the original query that was produced by the Parser.
+ *
+ * @var \Doctrine\ORM\Query\ParserResult
+ */
private $_parserResult;
+
+ /**
+ * The query components of the original query (the "symbol table") that was produced by the Parser.
+ *
+ * @var array
+ */
private $_queryComponents;
/**
@@ -43,20 +60,15 @@ abstract class TreeWalkerAdapter implements TreeWalker
}
/**
- * Return internal queryComponents array
- *
- * @return array:
+ * {@inheritdoc}
*/
public function getQueryComponents()
{
return $this->_queryComponents;
}
-
+
/**
- * Set or override a query component for a given dql alias.
- *
- * @param string $dqlAlias The DQL alias.
- * @param array $queryComponent
+ * {@inheritdoc}
*/
public function setQueryComponent($dqlAlias, array $queryComponent)
{
@@ -78,9 +90,9 @@ abstract class TreeWalkerAdapter implements TreeWalker
}
/**
- * Retrieve Query Instance reponsible for the current walkers execution.
+ * Retrieves the Query Instance reponsible for the current walkers execution.
*
- * @return \Doctrine\ORM\Query
+ * @return \Doctrine\ORM\AbstractQuery
*/
protected function _getQuery()
{
@@ -88,7 +100,7 @@ abstract class TreeWalkerAdapter implements TreeWalker
}
/**
- * Retrieve ParserResult
+ * Retrieves the ParserResult.
*
* @return \Doctrine\ORM\Query\ParserResult
*/
@@ -98,373 +110,331 @@ abstract class TreeWalkerAdapter implements TreeWalker
}
/**
- * Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSelectStatement(AST\SelectStatement $AST) {}
+ public function walkSelectStatement(AST\SelectStatement $AST)
+ {
+ }
/**
- * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSelectClause($selectClause) {}
+ public function walkSelectClause($selectClause)
+ {
+ }
/**
- * Walks down a FromClause AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkFromClause($fromClause) {}
+ public function walkFromClause($fromClause)
+ {
+ }
/**
- * Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkFunction($function) {}
+ public function walkFunction($function)
+ {
+ }
/**
- * Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkOrderByClause($orderByClause) {}
+ public function walkOrderByClause($orderByClause)
+ {
+ }
/**
- * Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkOrderByItem($orderByItem) {}
+ public function walkOrderByItem($orderByItem)
+ {
+ }
/**
- * Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- *
- * @param HavingClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkHavingClause($havingClause) {}
+ public function walkHavingClause($havingClause)
+ {
+ }
/**
- * Walks down a Join AST node and creates the corresponding SQL.
- *
- * @param Join $join
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkJoin($join) {}
+ public function walkJoin($join)
+ {
+ }
/**
- * Walks down a SelectExpression AST node and generates the corresponding SQL.
- *
- * @param SelectExpression $selectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSelectExpression($selectExpression) {}
+ public function walkSelectExpression($selectExpression)
+ {
+ }
/**
- * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- *
- * @param QuantifiedExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkQuantifiedExpression($qExpr) {}
+ public function walkQuantifiedExpression($qExpr)
+ {
+ }
/**
- * Walks down a Subselect AST node, thereby generating the appropriate SQL.
- *
- * @param Subselect
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSubselect($subselect) {}
+ public function walkSubselect($subselect)
+ {
+ }
/**
- * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- *
- * @param SubselectFromClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSubselectFromClause($subselectFromClause) {}
+ public function walkSubselectFromClause($subselectFromClause)
+ {
+ }
/**
- * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSimpleSelectClause($simpleSelectClause) {}
+ public function walkSimpleSelectClause($simpleSelectClause)
+ {
+ }
/**
- * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSimpleSelectExpression($simpleSelectExpression) {}
+ public function walkSimpleSelectExpression($simpleSelectExpression)
+ {
+ }
/**
- * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- *
- * @param AggregateExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkAggregateExpression($aggExpression) {}
+ public function walkAggregateExpression($aggExpression)
+ {
+ }
/**
- * Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkGroupByClause($groupByClause) {}
+ public function walkGroupByClause($groupByClause)
+ {
+ }
/**
- * Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkGroupByItem($groupByItem) {}
+ public function walkGroupByItem($groupByItem)
+ {
+ }
/**
- * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkUpdateStatement(AST\UpdateStatement $AST) {}
+ public function walkUpdateStatement(AST\UpdateStatement $AST)
+ {
+ }
/**
- * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkDeleteStatement(AST\DeleteStatement $AST) {}
+ public function walkDeleteStatement(AST\DeleteStatement $AST)
+ {
+ }
/**
- * Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkDeleteClause(AST\DeleteClause $deleteClause) {}
+ public function walkDeleteClause(AST\DeleteClause $deleteClause)
+ {
+ }
/**
- * Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkUpdateClause($updateClause) {}
+ public function walkUpdateClause($updateClause)
+ {
+ }
/**
- * Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkUpdateItem($updateItem) {}
+ public function walkUpdateItem($updateItem)
+ {
+ }
/**
- * Walks down a WhereClause AST node, thereby generating the appropriate SQL.
- *
- * @param WhereClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkWhereClause($whereClause) {}
+ public function walkWhereClause($whereClause)
+ {
+ }
/**
- * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkConditionalExpression($condExpr) {}
+ public function walkConditionalExpression($condExpr)
+ {
+ }
/**
- * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalTerm
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkConditionalTerm($condTerm) {}
+ public function walkConditionalTerm($condTerm)
+ {
+ }
/**
- * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalFactor
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkConditionalFactor($factor) {}
+ public function walkConditionalFactor($factor)
+ {
+ }
/**
- * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalPrimary
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkConditionalPrimary($primary) {}
+ public function walkConditionalPrimary($primary)
+ {
+ }
/**
- * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ExistsExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkExistsExpression($existsExpr) {}
+ public function walkExistsExpression($existsExpr)
+ {
+ }
/**
- * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- *
- * @param CollectionMemberExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkCollectionMemberExpression($collMemberExpr) {}
+ public function walkCollectionMemberExpression($collMemberExpr)
+ {
+ }
/**
- * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param EmptyCollectionComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) {}
+ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
+ {
+ }
/**
- * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param NullComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkNullComparisonExpression($nullCompExpr) {}
+ public function walkNullComparisonExpression($nullCompExpr)
+ {
+ }
/**
- * Walks down an InExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkInExpression($inExpr) {}
+ public function walkInExpression($inExpr)
+ {
+ }
/**
- * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InstanceOfExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- function walkInstanceOfExpression($instanceOfExpr) {}
+ function walkInstanceOfExpression($instanceOfExpr)
+ {
+ }
/**
- * Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkLiteral($literal) {}
+ public function walkLiteral($literal)
+ {
+ }
/**
- * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- *
- * @param BetweenExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkBetweenExpression($betweenExpr) {}
+ public function walkBetweenExpression($betweenExpr)
+ {
+ }
/**
- * Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- *
- * @param LikeExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkLikeExpression($likeExpr) {}
+ public function walkLikeExpression($likeExpr)
+ {
+ }
/**
- * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param StateFieldPathExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkStateFieldPathExpression($stateFieldPathExpression) {}
+ public function walkStateFieldPathExpression($stateFieldPathExpression)
+ {
+ }
/**
- * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkComparisonExpression($compExpr) {}
+ public function walkComparisonExpression($compExpr)
+ {
+ }
/**
- * Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- *
- * @param InputParameter
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkInputParameter($inputParam) {}
+ public function walkInputParameter($inputParam)
+ {
+ }
/**
- * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkArithmeticExpression($arithmeticExpr) {}
+ public function walkArithmeticExpression($arithmeticExpr)
+ {
+ }
/**
- * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkArithmeticTerm($term) {}
+ public function walkArithmeticTerm($term)
+ {
+ }
/**
- * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkStringPrimary($stringPrimary) {}
+ public function walkStringPrimary($stringPrimary)
+ {
+ }
/**
- * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkArithmeticFactor($factor) {}
+ public function walkArithmeticFactor($factor)
+ {
+ }
/**
- * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkSimpleArithmeticExpression($simpleArithmeticExpr) {}
+ public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
+ {
+ }
/**
- * Walks down an PathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkPathExpression($pathExpr) {}
+ public function walkPathExpression($pathExpr)
+ {
+ }
/**
- * Walks down an ResultVariable AST node, thereby generating the appropriate SQL.
- *
- * @param string $resultVariable
- * @return string The SQL.
+ * {@inheritdoc}
*/
- public function walkResultVariable($resultVariable) {}
+ public function walkResultVariable($resultVariable)
+ {
+ }
/**
- * Gets an executor that can be used to execute the result of this walker.
- *
- * @return AbstractExecutor
+ * {@inheritdoc}
*/
- public function getExecutor($AST) {}
+ public function getExecutor($AST)
+ {
+ }
}
diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/lib/Doctrine/ORM/Query/TreeWalkerChain.php
index f20413c40..4ce356d84 100644
--- a/lib/Doctrine/ORM/Query/TreeWalkerChain.php
+++ b/lib/Doctrine/ORM/Query/TreeWalkerChain.php
@@ -29,17 +29,36 @@ namespace Doctrine\ORM\Query;
*/
class TreeWalkerChain implements TreeWalker
{
- /** The tree walkers. */
+ /**
+ * The tree walkers.
+ *
+ * @var TreeWalker[]
+ */
private $_walkers = array();
- /** The original Query. */
+
+ /**
+ * The original Query.
+ *
+ * @var \Doctrine\ORM\AbstractQuery
+ */
private $_query;
- /** The ParserResult of the original query that was produced by the Parser. */
+
+ /**
+ * The ParserResult of the original query that was produced by the Parser.
+ *
+ * @var \Doctrine\ORM\Query\ParserResult
+ */
private $_parserResult;
- /** The query components of the original query (the "symbol table") that was produced by the Parser. */
+
+ /**
+ * The query components of the original query (the "symbol table") that was produced by the Parser.
+ *
+ * @var array
+ */
private $_queryComponents;
/**
- * Return internal queryComponents array
+ * Returns the internal queryComponents array.
*
* @return array
*/
@@ -49,10 +68,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Set or override a query component for a given dql alias.
- *
- * @param string $dqlAlias The DQL alias.
- * @param array $queryComponent
+ * {@inheritdoc}
*/
public function setQueryComponent($dqlAlias, array $queryComponent)
{
@@ -66,7 +82,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function __construct($query, $parserResult, array $queryComponents)
{
@@ -79,6 +95,8 @@ class TreeWalkerChain implements TreeWalker
* Adds a tree walker to the chain.
*
* @param string $walkerClass The class of the walker to instantiate.
+ *
+ * @return void
*/
public function addTreeWalker($walkerClass)
{
@@ -86,9 +104,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectStatement(AST\SelectStatement $AST)
{
@@ -100,9 +116,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectClause($selectClause)
{
@@ -112,9 +126,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a FromClause AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkFromClause($fromClause)
{
@@ -124,9 +136,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- *
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkFunction($function)
{
@@ -136,10 +146,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkOrderByClause($orderByClause)
{
@@ -149,10 +156,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- *
- * @param OrderByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkOrderByItem($orderByItem)
{
@@ -162,10 +166,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- *
- * @param HavingClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkHavingClause($havingClause)
{
@@ -175,10 +176,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a Join AST node and creates the corresponding SQL.
- *
- * @param Join $join
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkJoin($join)
{
@@ -188,10 +186,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SelectExpression AST node and generates the corresponding SQL.
- *
- * @param SelectExpression $selectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSelectExpression($selectExpression)
{
@@ -201,10 +196,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- *
- * @param QuantifiedExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkQuantifiedExpression($qExpr)
{
@@ -214,10 +206,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a Subselect AST node, thereby generating the appropriate SQL.
- *
- * @param Subselect
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSubselect($subselect)
{
@@ -227,10 +216,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- *
- * @param SubselectFromClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSubselectFromClause($subselectFromClause)
{
@@ -240,10 +226,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleSelectClause($simpleSelectClause)
{
@@ -253,10 +236,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleSelectExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleSelectExpression($simpleSelectExpression)
{
@@ -266,10 +246,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- *
- * @param AggregateExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkAggregateExpression($aggExpression)
{
@@ -279,10 +256,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkGroupByClause($groupByClause)
{
@@ -292,10 +266,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- *
- * @param GroupByItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkGroupByItem($groupByItem)
{
@@ -305,10 +276,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateStatement(AST\UpdateStatement $AST)
{
@@ -318,10 +286,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteStatement
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkDeleteStatement(AST\DeleteStatement $AST)
{
@@ -331,10 +296,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- *
- * @param DeleteClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkDeleteClause(AST\DeleteClause $deleteClause)
{
@@ -344,10 +306,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateClause($updateClause)
{
@@ -357,10 +316,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- *
- * @param UpdateItem
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkUpdateItem($updateItem)
{
@@ -370,10 +326,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a WhereClause AST node, thereby generating the appropriate SQL.
- *
- * @param WhereClause
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkWhereClause($whereClause)
{
@@ -383,10 +336,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalExpression($condExpr)
{
@@ -396,10 +346,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalTerm
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalTerm($condTerm)
{
@@ -409,10 +356,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalFactor
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalFactor($factor)
{
@@ -422,10 +366,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- *
- * @param ConditionalPrimary
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkConditionalPrimary($condPrimary)
{
@@ -435,10 +376,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ExistsExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkExistsExpression($existsExpr)
{
@@ -448,10 +386,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- *
- * @param CollectionMemberExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkCollectionMemberExpression($collMemberExpr)
{
@@ -461,10 +396,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param EmptyCollectionComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
{
@@ -474,10 +406,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param NullComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkNullComparisonExpression($nullCompExpr)
{
@@ -487,10 +416,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an InExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInExpression($inExpr)
{
@@ -500,10 +426,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- *
- * @param InstanceOfExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
function walkInstanceOfExpression($instanceOfExpr)
{
@@ -513,10 +436,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkLiteral($literal)
{
@@ -526,10 +446,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- *
- * @param BetweenExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkBetweenExpression($betweenExpr)
{
@@ -539,10 +456,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- *
- * @param LikeExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkLikeExpression($likeExpr)
{
@@ -552,10 +466,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param StateFieldPathExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkStateFieldPathExpression($stateFieldPathExpression)
{
@@ -565,10 +476,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ComparisonExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkComparisonExpression($compExpr)
{
@@ -578,10 +486,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- *
- * @param InputParameter
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkInputParameter($inputParam)
{
@@ -591,10 +496,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param ArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticExpression($arithmeticExpr)
{
@@ -604,10 +506,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticTerm($term)
{
@@ -617,10 +516,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkStringPrimary($stringPrimary)
{
@@ -630,10 +526,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkArithmeticFactor($factor)
{
@@ -643,10 +536,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- *
- * @param SimpleArithmeticExpression
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
{
@@ -656,10 +546,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an PathExpression AST node, thereby generating the appropriate SQL.
- *
- * @param mixed
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkPathExpression($pathExpr)
{
@@ -669,10 +556,7 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Walks down an ResultVariable AST node, thereby generating the appropriate SQL.
- *
- * @param string $resultVariable
- * @return string The SQL.
+ * {@inheritdoc}
*/
public function walkResultVariable($resultVariable)
{
@@ -682,10 +566,9 @@ class TreeWalkerChain implements TreeWalker
}
/**
- * Gets an executor that can be used to execute the result of this walker.
- *
- * @return AbstractExecutor
+ * {@inheritdoc}
*/
public function getExecutor($AST)
- {}
+ {
+ }
}
diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php
index aa7281028..fdaf702c4 100644
--- a/lib/Doctrine/ORM/QueryBuilder.php
+++ b/lib/Doctrine/ORM/QueryBuilder.php
@@ -41,17 +41,21 @@ class QueryBuilder
const DELETE = 1;
const UPDATE = 2;
- /** The builder states. */
+ /* The builder states. */
const STATE_DIRTY = 0;
const STATE_CLEAN = 1;
/**
- * @var EntityManager The EntityManager used by this QueryBuilder.
+ * The EntityManager used by this QueryBuilder.
+ *
+ * @var EntityManager
*/
private $_em;
/**
- * @var array The array of DQL parts collected.
+ * The array of DQL parts collected.
+ *
+ * @var array
*/
private $_dqlParts = array(
'distinct' => false,
@@ -66,37 +70,51 @@ class QueryBuilder
);
/**
- * @var integer The type of query this is. Can be select, update or delete.
+ * The type of query this is. Can be select, update or delete.
+ *
+ * @var integer
*/
private $_type = self::SELECT;
/**
- * @var integer The state of the query object. Can be dirty or clean.
+ * The state of the query object. Can be dirty or clean.
+ *
+ * @var integer
*/
private $_state = self::STATE_CLEAN;
/**
- * @var string The complete DQL string for this query.
+ * The complete DQL string for this query.
+ *
+ * @var string
*/
private $_dql;
/**
- * @var \Doctrine\Common\Collections\ArrayCollection The query parameters.
+ * The query parameters.
+ *
+ * @var \Doctrine\Common\Collections\ArrayCollection
*/
private $parameters = array();
/**
- * @var integer The index of the first result to retrieve.
+ * The index of the first result to retrieve.
+ *
+ * @var integer
*/
private $_firstResult = null;
/**
- * @var integer The maximum number of results to retrieve.
+ * The maximum number of results to retrieve.
+ *
+ * @var integer
*/
private $_maxResults = null;
/**
- * @var array Keeps root entity alias names for join entities.
+ * Keeps root entity alias names for join entities.
+ *
+ * @var array
*/
private $joinRootAliases = array();
@@ -133,7 +151,7 @@ class QueryBuilder
}
/**
- * Get the type of the currently built query.
+ * Gets the type of the currently built query.
*
* @return integer
*/
@@ -143,7 +161,7 @@ class QueryBuilder
}
/**
- * Get the associated EntityManager for this query builder.
+ * Gets the associated EntityManager for this query builder.
*
* @return EntityManager
*/
@@ -153,7 +171,7 @@ class QueryBuilder
}
/**
- * Get the state of this query builder instance.
+ * Gets the state of this query builder instance.
*
* @return integer Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN.
*/
@@ -163,7 +181,7 @@ class QueryBuilder
}
/**
- * Get the complete DQL string formed by the current specifications of this QueryBuilder.
+ * Gets the complete DQL string formed by the current specifications of this QueryBuilder.
*
*
* $qb = $em->createQueryBuilder()
@@ -229,8 +247,9 @@ class QueryBuilder
/**
* Finds the root entity alias of the joined entity.
*
- * @param string $alias The alias of the new join entity
+ * @param string $alias The alias of the new join entity
* @param string $parentAlias The parent entity alias of the join relationship
+ *
* @return string
*/
private function findRootAlias($alias, $parentAlias)
@@ -265,7 +284,8 @@ class QueryBuilder
*
*
* @deprecated Please use $qb->getRootAliases() instead.
- * @return string $rootAlias
+ *
+ * @return string
*/
public function getRootAlias()
{
@@ -285,7 +305,7 @@ class QueryBuilder
* $qb->getRootAliases(); // array('u')
*
*
- * @return array $rootAliases
+ * @return array
*/
public function getRootAliases()
{
@@ -318,7 +338,7 @@ class QueryBuilder
* $qb->getRootEntities(); // array('User')
*
*
- * @return array $rootEntities
+ * @return array
*/
public function getRootEntities()
{
@@ -350,9 +370,10 @@ class QueryBuilder
* ->setParameter('user_id', 1);
*
*
- * @param string|integer $key The parameter position or name.
- * @param mixed $value The parameter value.
- * @param string|null $type PDO::PARAM_* or \Doctrine\DBAL\Types\Type::* constant
+ * @param string|integer $key The parameter position or name.
+ * @param mixed $value The parameter value.
+ * @param string|null $type PDO::PARAM_* or \Doctrine\DBAL\Types\Type::* constant
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function setParameter($key, $value, $type = null)
@@ -393,7 +414,8 @@ class QueryBuilder
* )));
*
*
- * @param \Doctrine\Common\Collections\ArrayCollection|array $params The query parameters to set.
+ * @param \Doctrine\Common\Collections\ArrayCollection|array $parameters The query parameters to set.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function setParameters($parameters)
@@ -450,6 +472,7 @@ class QueryBuilder
* Sets the position of the first result to retrieve (the "offset").
*
* @param integer $firstResult The first result to return.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function setFirstResult($firstResult)
@@ -474,6 +497,7 @@ class QueryBuilder
* Sets the maximum number of results to retrieve (the "limit").
*
* @param integer $maxResults The maximum number of results to retrieve.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function setMaxResults($maxResults)
@@ -500,9 +524,10 @@ class QueryBuilder
* The available parts are: 'select', 'from', 'join', 'set', 'where',
* 'groupBy', 'having' and 'orderBy'.
*
- * @param string $dqlPartName
- * @param string $dqlPart
- * @param string $append
+ * @param string $dqlPartName
+ * @param Expr\Base $dqlPart
+ * @param bool $append
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function add($dqlPartName, $dqlPart, $append = false)
@@ -552,6 +577,7 @@ class QueryBuilder
*
*
* @param mixed $select The selection expressions.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function select($select = null)
@@ -568,7 +594,7 @@ class QueryBuilder
}
/**
- * Add a DISTINCT flag to this query.
+ * Adds a DISTINCT flag to this query.
*
*
* $qb = $em->createQueryBuilder()
@@ -577,7 +603,8 @@ class QueryBuilder
* ->from('User', 'u');
*
*
- * @param bool
+ * @param bool $flag
+ *
* @return QueryBuilder
*/
public function distinct($flag = true)
@@ -599,6 +626,7 @@ class QueryBuilder
*
*
* @param mixed $select The selection expression.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function addSelect($select = null)
@@ -626,7 +654,8 @@ class QueryBuilder
*
*
* @param string $delete The class/type whose instances are subject to the deletion.
- * @param string $alias The class/type alias used in the constructed query.
+ * @param string $alias The class/type alias used in the constructed query.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function delete($delete = null, $alias = null)
@@ -652,7 +681,8 @@ class QueryBuilder
*
*
* @param string $update The class/type whose instances are subject to the update.
- * @param string $alias The class/type alias used in the constructed query.
+ * @param string $alias The class/type alias used in the constructed query.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function update($update = null, $alias = null)
@@ -667,7 +697,7 @@ class QueryBuilder
}
/**
- * Create and add a query root corresponding to the entity identified by the given alias,
+ * Creates and adds a query root corresponding to the entity identified by the given alias,
* forming a cartesian product with any existing query roots.
*
*
@@ -676,9 +706,10 @@ class QueryBuilder
* ->from('User', 'u')
*
*
- * @param string $from The class name.
- * @param string $alias The alias of the class.
+ * @param string $from The class name.
+ * @param string $alias The alias of the class.
* @param string $indexBy The index for the from.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function from($from, $alias, $indexBy = null)
@@ -700,11 +731,12 @@ class QueryBuilder
* ->join('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1');
*
*
- * @param string $join The relationship to join
- * @param string $alias The alias of the join
- * @param string $conditionType The condition type constant. Either ON or WITH.
- * @param string $condition The condition for the join
- * @param string $indexBy The index for the join
+ * @param string $join The relationship to join.
+ * @param string $alias The alias of the join.
+ * @param string|null $conditionType The condition type constant. Either ON or WITH.
+ * @param string|null $condition The condition for the join.
+ * @param string|null $indexBy The index for the join.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function join($join, $alias, $conditionType = null, $condition = null, $indexBy = null)
@@ -725,11 +757,12 @@ class QueryBuilder
* ->from('User', 'u')
* ->innerJoin('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1');
*
- * @param string $join The relationship to join
- * @param string $alias The alias of the join
- * @param string $conditionType The condition type constant. Either ON or WITH.
- * @param string $condition The condition for the join
- * @param string $indexBy The index for the join
+ * @param string $join The relationship to join.
+ * @param string $alias The alias of the join.
+ * @param string|null $conditionType The condition type constant. Either ON or WITH.
+ * @param string|null $condition The condition for the join.
+ * @param string|null $indexBy The index for the join.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function innerJoin($join, $alias, $conditionType = null, $condition = null, $indexBy = null)
@@ -759,11 +792,12 @@ class QueryBuilder
* ->leftJoin('u.Phonenumbers', 'p', Expr\Join::WITH, 'p.is_primary = 1');
*
*
- * @param string $join The relationship to join
- * @param string $alias The alias of the join
- * @param string $conditionType The condition type constant. Either ON or WITH.
- * @param string $condition The condition for the join
- * @param string $indexBy The index for the join
+ * @param string $join The relationship to join.
+ * @param string $alias The alias of the join.
+ * @param string|null $conditionType The condition type constant. Either ON or WITH.
+ * @param string|null $condition The condition for the join.
+ * @param string|null $indexBy The index for the join.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function leftJoin($join, $alias, $conditionType = null, $condition = null, $indexBy = null)
@@ -789,8 +823,9 @@ class QueryBuilder
* ->where('u.id = ?');
*
*
- * @param string $key The key/field to set.
+ * @param string $key The key/field to set.
* @param string $value The value, expression, placeholder, etc.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function set($key, $value)
@@ -821,6 +856,7 @@ class QueryBuilder
*
*
* @param mixed $predicates The restriction predicates.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function where($predicates)
@@ -845,7 +881,9 @@ class QueryBuilder
*
*
* @param mixed $where The query restrictions.
+ *
* @return QueryBuilder This QueryBuilder instance.
+ *
* @see where()
*/
public function andWhere($where)
@@ -875,8 +913,10 @@ class QueryBuilder
* ->orWhere('u.id = 2');
*
*
- * @param mixed $where The WHERE statement
- * @return QueryBuilder $qb
+ * @param mixed $where The WHERE statement.
+ *
+ * @return QueryBuilder
+ *
* @see where()
*/
public function orWhere($where)
@@ -906,6 +946,7 @@ class QueryBuilder
*
*
* @param string $groupBy The grouping expression.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function groupBy($groupBy)
@@ -913,7 +954,6 @@ class QueryBuilder
return $this->add('groupBy', new Expr\GroupBy(func_get_args()));
}
-
/**
* Adds a grouping expression to the query.
*
@@ -926,6 +966,7 @@ class QueryBuilder
*
*
* @param string $groupBy The grouping expression.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function addGroupBy($groupBy)
@@ -938,6 +979,7 @@ class QueryBuilder
* Replaces any previous having restrictions, if any.
*
* @param mixed $having The restriction over the groups.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function having($having)
@@ -954,6 +996,7 @@ class QueryBuilder
* conjunction with any existing having restrictions.
*
* @param mixed $having The restriction to append.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function andHaving($having)
@@ -976,6 +1019,7 @@ class QueryBuilder
* disjunction with any existing having restrictions.
*
* @param mixed $having The restriction to add.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function orHaving($having)
@@ -997,8 +1041,9 @@ class QueryBuilder
* Specifies an ordering for the query results.
* Replaces any previously specified orderings, if any.
*
- * @param string $sort The ordering expression.
+ * @param string $sort The ordering expression.
* @param string $order The ordering direction.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function orderBy($sort, $order = null)
@@ -1011,8 +1056,9 @@ class QueryBuilder
/**
* Adds an ordering to the query results.
*
- * @param string $sort The ordering expression.
+ * @param string $sort The ordering expression.
* @param string $order The ordering direction.
+ *
* @return QueryBuilder This QueryBuilder instance.
*/
public function addOrderBy($sort, $order = null)
@@ -1021,12 +1067,14 @@ class QueryBuilder
}
/**
- * Add criteria to query.
- * Add where expressions with AND operator.
- * Add orderings.
- * Override firstResult and maxResults if they set.
+ * Adds criteria to the query.
+ *
+ * Adds where expressions with AND operator.
+ * Adds orderings.
+ * Overrides firstResult and maxResults if they're set.
*
* @param Criteria $criteria
+ *
* @return QueryBuilder
*/
public function addCriteria(Criteria $criteria)
@@ -1058,10 +1106,12 @@ class QueryBuilder
}
/**
- * Get a query part by its name.
+ * Gets a query part by its name.
*
* @param string $queryPartName
+ *
* @return mixed $queryPart
+ *
* @todo Rename: getQueryPart (or remove?)
*/
public function getDQLPart($queryPartName)
@@ -1070,9 +1120,10 @@ class QueryBuilder
}
/**
- * Get all query parts.
+ * Gets all query parts.
*
* @return array $dqlParts
+ *
* @todo Rename: getQueryParts (or remove?)
*/
public function getDQLParts()
@@ -1080,6 +1131,9 @@ class QueryBuilder
return $this->_dqlParts;
}
+ /**
+ * @return string
+ */
private function _getDQLForDelete()
{
return 'DELETE'
@@ -1088,6 +1142,9 @@ class QueryBuilder
. $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
}
+ /**
+ * @return string
+ */
private function _getDQLForUpdate()
{
return 'UPDATE'
@@ -1097,6 +1154,9 @@ class QueryBuilder
. $this->_getReducedDQLQueryPart('orderBy', array('pre' => ' ORDER BY ', 'separator' => ', '));
}
+ /**
+ * @return string
+ */
private function _getDQLForSelect()
{
$dql = 'SELECT'
@@ -1133,6 +1193,12 @@ class QueryBuilder
return $dql;
}
+ /**
+ * @param string $queryPartName
+ * @param array $options
+ *
+ * @return string
+ */
private function _getReducedDQLQueryPart($queryPartName, $options = array())
{
$queryPart = $this->getDQLPart($queryPartName);
@@ -1147,9 +1213,10 @@ class QueryBuilder
}
/**
- * Reset DQL parts
+ * Resets DQL parts.
+ *
+ * @param array|null $parts
*
- * @param array $parts
* @return QueryBuilder
*/
public function resetDQLParts($parts = null)
@@ -1166,10 +1233,11 @@ class QueryBuilder
}
/**
- * Reset single DQL part
+ * Resets single DQL part.
*
* @param string $part
- * @return QueryBuilder;
+ *
+ * @return QueryBuilder
*/
public function resetDQLPart($part)
{
@@ -1191,7 +1259,7 @@ class QueryBuilder
}
/**
- * Deep clone of all expression objects in the DQL parts.
+ * Deep clones all expression objects in the DQL parts.
*
* @return void
*/
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php
index dc75c5b51..c90adbedb 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php
@@ -28,7 +28,6 @@ use Doctrine\Common\Cache\ApcCache;
/**
* Command to clear the metadata cache of the various cache drivers.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,7 +38,7 @@ use Doctrine\Common\Cache\ApcCache;
class MetadataCommand extends Command
{
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -74,7 +73,7 @@ EOT
}
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php
index df20677f1..6c8d761ca 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php
@@ -28,7 +28,6 @@ use Doctrine\Common\Cache\ApcCache;
/**
* Command to clear the query cache of the various cache drivers.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -38,6 +37,9 @@ use Doctrine\Common\Cache\ApcCache;
*/
class QueryCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -70,6 +72,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php
index 0ec683405..26eb3d46d 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php
@@ -28,7 +28,6 @@ use Doctrine\Common\Cache\ApcCache;
/**
* Command to clear the result cache of the various cache drivers.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,7 +38,7 @@ use Doctrine\Common\Cache\ApcCache;
class ResultCommand extends Command
{
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -74,7 +73,7 @@ EOT
}
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php
index d07d40965..725d2bf83 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php
@@ -19,13 +19,12 @@
namespace Doctrine\ORM\Tools\Console\Command;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Symfony\Component\Console,
- Doctrine\ORM\Tools\Export\ClassMetadataExporter,
- Doctrine\ORM\Tools\ConvertDoctrine1Schema,
- Doctrine\ORM\Tools\EntityGenerator;
-use Doctrine\ORM\EntityManager;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console;
+use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
+use Doctrine\ORM\Tools\ConvertDoctrine1Schema;
+use Doctrine\ORM\Tools\EntityGenerator;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Command\Command;
@@ -33,7 +32,6 @@ use Symfony\Component\Console\Command\Command;
/**
* Command to convert a Doctrine 1 schema to a Doctrine 2 mapping file.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -44,12 +42,12 @@ use Symfony\Component\Console\Command\Command;
class ConvertDoctrine1SchemaCommand extends Command
{
/**
- * @var EntityGenerator
+ * @var EntityGenerator|null
*/
private $entityGenerator = null;
/**
- * @var ClassMetadataExporter
+ * @var ClassMetadataExporter|null
*/
private $metadataExporter = null;
@@ -67,6 +65,8 @@ class ConvertDoctrine1SchemaCommand extends Command
/**
* @param EntityGenerator $entityGenerator
+ *
+ * @return void
*/
public function setEntityGenerator(EntityGenerator $entityGenerator)
{
@@ -87,6 +87,8 @@ class ConvertDoctrine1SchemaCommand extends Command
/**
* @param ClassMetadataExporter $metadataExporter
+ *
+ * @return void
*/
public function setMetadataExporter(ClassMetadataExporter $metadataExporter)
{
@@ -94,7 +96,7 @@ class ConvertDoctrine1SchemaCommand extends Command
}
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -132,6 +134,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
// Process source directories
@@ -148,12 +153,14 @@ EOT
}
/**
- * @param array $fromPaths
- * @param string $destPath
- * @param string $toType
- * @param int $numSpaces
- * @param string|null $extend
+ * @param array $fromPaths
+ * @param string $destPath
+ * @param string $toType
+ * @param int $numSpaces
+ * @param string|null $extend
* @param OutputInterface $output
+ *
+ * @throws \InvalidArgumentException
*/
public function convertDoctrine1Schema(array $fromPaths, $destPath, $toType, $numSpaces, $extend, OutputInterface $output)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
index 8acdf2166..df561d583 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php
@@ -19,12 +19,12 @@
namespace Doctrine\ORM\Tools\Console\Command;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Doctrine\ORM\Tools\Console\MetadataFilter,
- Doctrine\ORM\Tools\Export\ClassMetadataExporter,
- Doctrine\ORM\Tools\EntityGenerator,
- Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Doctrine\ORM\Tools\Console\MetadataFilter;
+use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
+use Doctrine\ORM\Tools\EntityGenerator;
+use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
use Doctrine\ORM\Mapping\Driver\DatabaseDriver;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
@@ -33,7 +33,6 @@ use Symfony\Component\Console\Command\Command;
/**
* Command to convert your mapping information between the various formats.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -43,6 +42,9 @@ use Symfony\Component\Console\Command\Command;
*/
class ConvertMappingCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -100,6 +102,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
@@ -174,8 +179,8 @@ EOT
}
/**
- * @param $toType
- * @param $destPath
+ * @param string $toType
+ * @param string $destPath
*
* @return \Doctrine\ORM\Tools\Export\Driver\AbstractExporter
*/
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
index 67461e293..3601570eb 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php
@@ -27,7 +27,6 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* Command to ensure that Doctrine is properly configured for a production environment.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
@@ -38,6 +37,9 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
class EnsureProductionSettingsCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -46,7 +48,7 @@ class EnsureProductionSettingsCommand extends Command
->setDefinition(array(
new InputOption(
'complete', null, InputOption::VALUE_NONE,
- 'Flag to also inspect database connection existance.'
+ 'Flag to also inspect database connection existence.'
)
))
->setHelp(<<getHelper('em')->getEntityManager();
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php
index a97801eff..377841f1e 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php
@@ -19,11 +19,11 @@
namespace Doctrine\ORM\Tools\Console\Command;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Doctrine\ORM\Tools\Console\MetadataFilter,
- Doctrine\ORM\Tools\EntityGenerator,
- Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Doctrine\ORM\Tools\Console\MetadataFilter;
+use Doctrine\ORM\Tools\EntityGenerator;
+use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Command\Command;
@@ -31,7 +31,6 @@ use Symfony\Component\Console\Command\Command;
/**
* Command to generate entity classes and method stubs from your mapping information.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -42,7 +41,7 @@ use Symfony\Component\Console\Command\Command;
class GenerateEntitiesCommand extends Command
{
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -106,7 +105,7 @@ EOT
}
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php
index 8b86e07b5..1de9dd7dc 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php
@@ -19,9 +19,9 @@
namespace Doctrine\ORM\Tools\Console\Command;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Doctrine\ORM\Tools\Console\MetadataFilter;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Doctrine\ORM\Tools\Console\MetadataFilter;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Command\Command;
@@ -29,7 +29,6 @@ use Symfony\Component\Console\Command\Command;
/**
* Command to (re)generate the proxy classes used by doctrine.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,6 +38,9 @@ use Symfony\Component\Console\Command\Command;
*/
class GenerateProxiesCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -60,6 +62,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
@@ -105,6 +110,5 @@ EOT
} else {
$output->writeln('No Metadata Classes to process.');
}
-
}
}
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php
index d021a18f9..7d1bd4c04 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php
@@ -19,10 +19,10 @@
namespace Doctrine\ORM\Tools\Console\Command;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Doctrine\ORM\Tools\Console\MetadataFilter,
- Doctrine\ORM\Tools\EntityRepositoryGenerator;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Doctrine\ORM\Tools\Console\MetadataFilter;
+use Doctrine\ORM\Tools\EntityRepositoryGenerator;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Command\Command;
@@ -30,7 +30,6 @@ use Symfony\Component\Console\Command\Command;
/**
* Command to generate repository classes for mapping information.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -40,6 +39,9 @@ use Symfony\Component\Console\Command\Command;
*/
class GenerateRepositoriesCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -60,6 +62,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php
index 212d714c7..f23fe22c1 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php
@@ -25,8 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
/**
- * Show information about mapped entities
- *
+ * Show information about mapped entities.
*
* @link www.doctrine-project.org
* @since 2.1
@@ -34,6 +33,9 @@ use Symfony\Component\Console\Command\Command;
*/
class InfoCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -47,6 +49,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
/* @var $entityManager \Doctrine\ORM\EntityManager */
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php
index 6df4daf8e..1189b8194 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php
@@ -29,7 +29,6 @@ use Doctrine\Common\Util\Debug;
/**
* Command to execute DQL queries in a given EntityManager.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,6 +38,9 @@ use Doctrine\Common\Util\Debug;
*/
class RunDqlCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -70,6 +72,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php
index 0dcc198c8..707e510e3 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php
@@ -19,11 +19,21 @@
namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
-use Symfony\Component\Console\Input\InputInterface,
- Symfony\Component\Console\Output\OutputInterface,
- Symfony\Component\Console\Command\Command,
- Doctrine\ORM\Tools\SchemaTool;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Command\Command;
+use Doctrine\ORM\Tools\SchemaTool;
+/**
+ * Base class for CreateCommand, DropCommand and UpdateCommand.
+ *
+ * @link www.doctrine-project.org
+ * @since 2.0
+ * @author Benjamin Eberlei
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ */
abstract class AbstractCommand extends Command
{
/**
@@ -31,11 +41,13 @@ abstract class AbstractCommand extends Command
* @param OutputInterface $output
* @param SchemaTool $schemaTool
* @param array $metadatas
+ *
+ * @return null|int Null or 0 if everything went fine, or an error code.
*/
abstract protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas);
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
index 3fa000190..bcbe47d51 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php
@@ -19,16 +19,15 @@
namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Symfony\Component\Console\Input\InputInterface,
- Symfony\Component\Console\Output\OutputInterface,
- Doctrine\ORM\Tools\SchemaTool;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Doctrine\ORM\Tools\SchemaTool;
/**
* Command to create the database schema for a set of classes based on their mappings.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,7 +38,7 @@ use Symfony\Component\Console\Input\InputArgument,
class CreateCommand extends AbstractCommand
{
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -60,6 +59,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
if ($input->getOption('dump-sql')) {
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php
index 86a50a4c3..4e9964023 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php
@@ -19,16 +19,15 @@
namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Symfony\Component\Console\Input\InputInterface,
- Symfony\Component\Console\Output\OutputInterface,
- Doctrine\ORM\Tools\SchemaTool;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Doctrine\ORM\Tools\SchemaTool;
/**
* Command to drop the database schema for a set of classes based on their mappings.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -39,7 +38,7 @@ use Symfony\Component\Console\Input\InputArgument,
class DropCommand extends AbstractCommand
{
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -69,6 +68,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
$isFullDatabaseDrop = $input->getOption('full-database');
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php
index dc3d065ca..4677dfb30 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php
@@ -19,17 +19,16 @@
namespace Doctrine\ORM\Tools\Console\Command\SchemaTool;
-use Symfony\Component\Console\Input\InputArgument,
- Symfony\Component\Console\Input\InputOption,
- Symfony\Component\Console\Input\InputInterface,
- Symfony\Component\Console\Output\OutputInterface,
- Doctrine\ORM\Tools\SchemaTool;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Doctrine\ORM\Tools\SchemaTool;
/**
* Command to generate the SQL needed to update the database schema to match
* the current mapping information.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -40,10 +39,13 @@ use Symfony\Component\Console\Input\InputArgument,
*/
class UpdateCommand extends AbstractCommand
{
+ /**
+ * @var string
+ */
protected $name = 'orm:schema-tool:update';
/**
- * @see Console\Command\Command
+ * {@inheritdoc}
*/
protected function configure()
{
@@ -95,6 +97,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function executeSchemaCommand(InputInterface $input, OutputInterface $output, SchemaTool $schemaTool, array $metadatas)
{
// Defining if update is complete or not (--complete not defined means $saveMode = true)
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php
index 0e42b4e22..4bffbf76e 100644
--- a/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php
+++ b/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php
@@ -25,7 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\ORM\Tools\SchemaValidator;
/**
- * Validate that the current mapping is valid
+ * Command to validate that the current mapping is valid.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
@@ -37,6 +37,9 @@ use Doctrine\ORM\Tools\SchemaValidator;
*/
class ValidateSchemaCommand extends Command
{
+ /**
+ * {@inheritdoc}
+ */
protected function configure()
{
$this
@@ -48,6 +51,9 @@ EOT
);
}
+ /**
+ * {@inheritdoc}
+ */
protected function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getHelper('em')->getEntityManager();
diff --git a/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php b/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php
index 2b34d6765..5122ac8de 100644
--- a/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php
+++ b/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php
@@ -26,10 +26,11 @@ use Doctrine\ORM\Version;
class ConsoleRunner
{
/**
- * Run console with the given helperset.
+ * Runs console with the given helperset.
*
- * @param \Symfony\Component\Console\Helper\HelperSet $helperSet
+ * @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
+ *
* @return void
*/
static public function run(HelperSet $helperSet, $commands = array())
@@ -44,6 +45,8 @@ class ConsoleRunner
/**
* @param Application $cli
+ *
+ * @return void
*/
static public function addCommands(Application $cli)
{
diff --git a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php
index 049f0fc14..942033fdb 100644
--- a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php
+++ b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php
@@ -19,13 +19,12 @@
namespace Doctrine\ORM\Tools\Console\Helper;
-use Symfony\Component\Console\Helper\Helper,
- Doctrine\ORM\EntityManager;
+use Symfony\Component\Console\Helper\Helper;
+use Doctrine\ORM\EntityManager;
/**
* Doctrine CLI Connection Helper.
*
- *
* @link www.doctrine-project.org
* @since 2.0
* @author Benjamin Eberlei
@@ -36,13 +35,14 @@ use Symfony\Component\Console\Helper\Helper,
class EntityManagerHelper extends Helper
{
/**
- * Doctrine ORM EntityManager
+ * Doctrine ORM EntityManager.
+ *
* @var EntityManager
*/
protected $_em;
/**
- * Constructor
+ * Constructor.
*
* @param \Doctrine\ORM\EntityManager $em
*/
@@ -52,7 +52,7 @@ class EntityManagerHelper extends Helper
}
/**
- * Retrieves Doctrine ORM EntityManager
+ * Retrieves Doctrine ORM EntityManager.
*
* @return EntityManager
*/
@@ -62,7 +62,7 @@ class EntityManagerHelper extends Helper
}
/**
- * @see Helper
+ * {@inheritdoc}
*/
public function getName()
{
diff --git a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
index 0a03bb047..4f7813c1f 100644
--- a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
+++ b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
@@ -32,6 +32,9 @@ namespace Doctrine\ORM\Tools\Console;
*/
class MetadataFilter extends \FilterIterator implements \Countable
{
+ /**
+ * @var array
+ */
private $filter = array();
/**
@@ -49,6 +52,10 @@ class MetadataFilter extends \FilterIterator implements \Countable
return iterator_to_array($metadatas);
}
+ /**
+ * @param \ArrayIterator $metadata
+ * @param array|string $filter
+ */
public function __construct(\ArrayIterator $metadata, $filter)
{
$this->filter = (array) $filter;
@@ -56,6 +63,9 @@ class MetadataFilter extends \FilterIterator implements \Countable
parent::__construct($metadata);
}
+ /**
+ * @return bool
+ */
public function accept()
{
if (count($this->filter) == 0) {
@@ -74,6 +84,9 @@ class MetadataFilter extends \FilterIterator implements \Countable
return false;
}
+ /**
+ * @return int
+ */
public function count()
{
return count($this->getInnerIterator());
diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
index 137d7cc82..540945388 100644
--- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
+++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
@@ -36,7 +36,14 @@ use Symfony\Component\Yaml\Yaml;
*/
class ConvertDoctrine1Schema
{
+ /**
+ * @var array
+ */
private $from;
+
+ /**
+ * @var array
+ */
private $legacyTypeMap = array(
// TODO: This list may need to be updated
'clob' => 'text',
@@ -46,9 +53,10 @@ class ConvertDoctrine1Schema
/**
* Constructor passes the directory or array of directories
- * to convert the Doctrine 1 schema files from
+ * to convert the Doctrine 1 schema files from.
*
* @param array $from
+ *
* @author Jonathan Wage
*/
public function __construct($from)
@@ -57,10 +65,10 @@ class ConvertDoctrine1Schema
}
/**
- * Get an array of ClassMetadataInfo instances from the passed
- * Doctrine 1 schema
+ * Gets an array of ClassMetadataInfo instances from the passed
+ * Doctrine 1 schema.
*
- * @return array $metadatas An array of ClassMetadataInfo instances
+ * @return array An array of ClassMetadataInfo instances
*/
public function getMetadata()
{
@@ -84,6 +92,12 @@ class ConvertDoctrine1Schema
return $metadatas;
}
+ /**
+ * @param string $className
+ * @param array $mappingInformation
+ *
+ * @return \Doctrine\ORM\Mapping\ClassMetadataInfo
+ */
private function convertToClassMetadataInfo($className, $mappingInformation)
{
$metadata = new ClassMetadataInfo($className);
@@ -96,6 +110,13 @@ class ConvertDoctrine1Schema
return $metadata;
}
+ /**
+ * @param string $className
+ * @param array $model
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return void
+ */
private function convertTableName($className, array $model, ClassMetadataInfo $metadata)
{
if (isset($model['tableName']) && $model['tableName']) {
@@ -110,6 +131,13 @@ class ConvertDoctrine1Schema
}
}
+ /**
+ * @param string $className
+ * @param array $model
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return void
+ */
private function convertColumns($className, array $model, ClassMetadataInfo $metadata)
{
$id = false;
@@ -136,6 +164,16 @@ class ConvertDoctrine1Schema
}
}
+ /**
+ * @param string $className
+ * @param string $name
+ * @param string|array $column
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return array
+ *
+ * @throws ToolsException
+ */
private function convertColumn($className, $name, $column, ClassMetadataInfo $metadata)
{
if (is_string($column)) {
@@ -217,6 +255,13 @@ class ConvertDoctrine1Schema
return $fieldMapping;
}
+ /**
+ * @param string $className
+ * @param array $model
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return void
+ */
private function convertIndexes($className, array $model, ClassMetadataInfo $metadata)
{
if (empty($model['indexes'])) {
@@ -233,6 +278,13 @@ class ConvertDoctrine1Schema
}
}
+ /**
+ * @param string $className
+ * @param array $model
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return void
+ */
private function convertRelations($className, array $model, ClassMetadataInfo $metadata)
{
if (empty($model['relations'])) {
diff --git a/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php b/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php
index 0dc1c5a49..c812ae942 100644
--- a/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php
+++ b/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php
@@ -32,11 +32,18 @@ use Doctrine\ORM\EntityManager;
*/
class DebugUnitOfWorkListener
{
+ /**
+ * @var string
+ */
private $file;
+
+ /**
+ * @var string
+ */
private $context;
/**
- * Pass a stream and contet information for the debugging session.
+ * Pass a stream and context information for the debugging session.
*
* The stream can be php://output to print to the screen.
*
@@ -49,15 +56,21 @@ class DebugUnitOfWorkListener
$this->context = $context;
}
+ /**
+ * @param \Doctrine\ORM\Event\OnFlushEventArgs $args
+ *
+ * @return void
+ */
public function onFlush(OnFlushEventArgs $args)
{
$this->dumpIdentityMap($args->getEntityManager());
}
/**
- * Dump the contents of the identity map into a stream.
+ * Dumps the contents of the identity map into a stream.
*
* @param EntityManager $em
+ *
* @return void
*/
public function dumpIdentityMap(EntityManager $em)
@@ -119,6 +132,11 @@ class DebugUnitOfWorkListener
fclose($fh);
}
+ /**
+ * @param mixed $var
+ *
+ * @return string
+ */
private function getType($var)
{
if (is_object($var)) {
@@ -130,6 +148,12 @@ class DebugUnitOfWorkListener
return gettype($var);
}
+ /**
+ * @param object $entity
+ * @param UnitOfWork $uow
+ *
+ * @return string
+ */
private function getIdString($entity, UnitOfWork $uow)
{
if ($uow->isInIdentityMap($entity)) {
diff --git a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php
index 3ffa665a5..7a3ec6f89 100644
--- a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php
+++ b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php
@@ -38,6 +38,9 @@ use Doctrine\ORM\Mapping\ClassMetadataFactory;
*/
class DisconnectedClassMetadataFactory extends ClassMetadataFactory
{
+ /**
+ * @return \Doctrine\Common\Persistence\Mapping\StaticReflectionService
+ */
public function getReflectionService()
{
return new StaticReflectionService();
diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php
index 4a14871d1..2c6b8977f 100644
--- a/lib/Doctrine/ORM/Tools/EntityGenerator.php
+++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -24,7 +24,7 @@ use Doctrine\Common\Util\Inflector;
use Doctrine\DBAL\Types\Type;
/**
- * Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances
+ * Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances.
*
* [php]
* $classes = $em->getClassMetadataFactory()->getAllMetadata();
@@ -47,12 +47,12 @@ use Doctrine\DBAL\Types\Type;
class EntityGenerator
{
/**
- * Specifies class fields should be protected
+ * Specifies class fields should be protected.
*/
const FIELD_VISIBLE_PROTECTED = 'protected';
/**
- * Specifies class fields should be private
+ * Specifies class fields should be private.
*/
const FIELD_VISIBLE_PRIVATE = 'private';
@@ -62,14 +62,14 @@ class EntityGenerator
protected $backupExisting = true;
/**
- * The extension to use for written php files
+ * The extension to use for written php files.
*
* @var string
*/
protected $extension = '.php';
/**
- * Whether or not the current ClassMetadataInfo instance is new or old
+ * Whether or not the current ClassMetadataInfo instance is new or old.
*
* @var boolean
*/
@@ -81,26 +81,26 @@ class EntityGenerator
protected $staticReflection = array();
/**
- * Number of spaces to use for indention in generated code
+ * Number of spaces to use for indention in generated code.
*/
protected $numSpaces = 4;
/**
- * The actual spaces to use for indention
+ * The actual spaces to use for indention.
*
* @var string
*/
protected $spaces = ' ';
/**
- * The class all generated entities should extend
+ * The class all generated entities should extend.
*
* @var string
*/
protected $classToExtend;
/**
- * Whether or not to generation annotations
+ * Whether or not to generation annotations.
*
* @var boolean
*/
@@ -112,21 +112,21 @@ class EntityGenerator
protected $annotationsPrefix = '';
/**
- * Whether or not to generated sub methods
+ * Whether or not to generate sub methods.
*
* @var boolean
*/
protected $generateEntityStubMethods = false;
/**
- * Whether or not to update the entity class if it exists already
+ * Whether or not to update the entity class if it exists already.
*
* @var boolean
*/
protected $updateEntityIfExists = false;
/**
- * Whether or not to re-generate entity class if it exists already
+ * Whether or not to re-generate entity class if it exists already.
*
* @var boolean
*/
@@ -138,7 +138,7 @@ class EntityGenerator
protected $fieldVisibility = 'private';
/**
- * Hash-map for handle types
+ * Hash-map for handle types.
*
* @var array
*/
@@ -158,7 +158,9 @@ class EntityGenerator
);
/**
- * @var array Hash-map to handle generator types string.
+ * Hash-map to handle generator types string.
+ *
+ * @var array
*/
protected static $generatorStrategyMap = array(
ClassMetadataInfo::GENERATOR_TYPE_AUTO => 'AUTO',
@@ -171,7 +173,9 @@ class EntityGenerator
);
/**
- * @var array Hash-map to handle the change tracking policy string.
+ * Hash-map to handle the change tracking policy string.
+ *
+ * @var array
*/
protected static $changeTrackingPolicyMap = array(
ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT => 'DEFERRED_IMPLICIT',
@@ -180,7 +184,9 @@ class EntityGenerator
);
/**
- * @var array Hash-map to handle the inheritance type string.
+ * Hash-map to handle the inheritance type string.
+ *
+ * @var array
*/
protected static $inheritanceTypeMap = array(
ClassMetadataInfo::INHERITANCE_TYPE_NONE => 'NONE',
@@ -293,6 +299,9 @@ public function __construct()
}
';
+ /**
+ * Constructor.
+ */
public function __construct()
{
if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
@@ -301,10 +310,11 @@ public function __construct()
}
/**
- * Generate and write entity classes for the given array of ClassMetadataInfo instances
+ * Generates and writes entity classes for the given array of ClassMetadataInfo instances.
*
- * @param array $metadatas
+ * @param array $metadatas
* @param string $outputDirectory
+ *
* @return void
*/
public function generate(array $metadatas, $outputDirectory)
@@ -315,11 +325,14 @@ public function __construct()
}
/**
- * Generated and write entity class to disk for the given ClassMetadataInfo instance
+ * Generates and writes entity class to disk for the given ClassMetadataInfo instance.
*
* @param ClassMetadataInfo $metadata
- * @param string $outputDirectory
+ * @param string $outputDirectory
+ *
* @return void
+ *
+ * @throws \RuntimeException
*/
public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory)
{
@@ -355,10 +368,11 @@ public function __construct()
}
/**
- * Generate a PHP5 Doctrine 2 entity class from the given ClassMetadataInfo instance
+ * Generates a PHP5 Doctrine 2 entity class from the given ClassMetadataInfo instance.
*
* @param ClassMetadataInfo $metadata
- * @return string $code
+ *
+ * @return string
*/
public function generateEntityClass(ClassMetadataInfo $metadata)
{
@@ -382,11 +396,12 @@ public function __construct()
}
/**
- * Generate the updated code for the given ClassMetadataInfo and entity at path
+ * Generates the updated code for the given ClassMetadataInfo and entity at path.
*
* @param ClassMetadataInfo $metadata
- * @param string $path
- * @return string $code;
+ * @param string $path
+ *
+ * @return string
*/
public function generateUpdatedEntityClass(ClassMetadataInfo $metadata, $path)
{
@@ -400,9 +415,10 @@ public function __construct()
}
/**
- * Set the number of spaces the exported class should have
+ * Sets the number of spaces the exported class should have.
*
* @param integer $numSpaces
+ *
* @return void
*/
public function setNumSpaces($numSpaces)
@@ -412,9 +428,10 @@ public function __construct()
}
/**
- * Set the extension to use when writing php files to disk
+ * Sets the extension to use when writing php files to disk.
*
* @param string $extension
+ *
* @return void
*/
public function setExtension($extension)
@@ -423,7 +440,9 @@ public function __construct()
}
/**
- * Set the name of the class the generated classes should extend from
+ * Sets the name of the class the generated classes should extend from.
+ *
+ * @param string $classToExtend
*
* @return void
*/
@@ -433,9 +452,10 @@ public function __construct()
}
/**
- * Set whether or not to generate annotations for the entity
+ * Sets whether or not to generate annotations for the entity.
*
* @param bool $bool
+ *
* @return void
*/
public function setGenerateAnnotations($bool)
@@ -444,10 +464,13 @@ public function __construct()
}
/**
- * Set the class fields visibility for the entity (can either be private or protected)
+ * Sets the class fields visibility for the entity (can either be private or protected).
+ *
+ * @param bool $visibility
*
- * @param bool $bool
* @return void
+ *
+ * @throws \InvalidArgumentException
*/
public function setFieldVisibility($visibility)
{
@@ -459,9 +482,11 @@ public function __construct()
}
/**
- * Set an annotation prefix.
+ * Sets an annotation prefix.
*
* @param string $prefix
+ *
+ * @return void
*/
public function setAnnotationPrefix($prefix)
{
@@ -469,9 +494,10 @@ public function __construct()
}
/**
- * Set whether or not to try and update the entity if it already exists
+ * Sets whether or not to try and update the entity if it already exists.
*
* @param bool $bool
+ *
* @return void
*/
public function setUpdateEntityIfExists($bool)
@@ -480,9 +506,10 @@ public function __construct()
}
/**
- * Set whether or not to regenerate the entity if it exists
+ * Sets whether or not to regenerate the entity if it exists.
*
* @param bool $bool
+ *
* @return void
*/
public function setRegenerateEntityIfExists($bool)
@@ -491,9 +518,10 @@ public function __construct()
}
/**
- * Set whether or not to generate stub methods for the entity
+ * Sets whether or not to generate stub methods for the entity.
*
* @param bool $bool
+ *
* @return void
*/
public function setGenerateStubMethods($bool)
@@ -503,15 +531,20 @@ public function __construct()
/**
* Should an existing entity be backed up if it already exists?
+ *
+ * @param bool $bool
+ *
+ * @return void
*/
public function setBackupExisting($bool)
{
$this->backupExisting = $bool;
}
- /**
- * @param string $type
- * @return string
+ /**
+ * @param string $type
+ *
+ * @return string
*/
protected function getType($type)
{
@@ -522,6 +555,11 @@ public function __construct()
return $type;
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityNamespace(ClassMetadataInfo $metadata)
{
if ($this->hasNamespace($metadata)) {
@@ -529,12 +567,22 @@ public function __construct()
}
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityClassName(ClassMetadataInfo $metadata)
{
return 'class ' . $this->getClassName($metadata) .
($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityBody(ClassMetadataInfo $metadata)
{
$fieldMappingProperties = $this->generateEntityFieldMappingProperties($metadata);
@@ -565,6 +613,11 @@ public function __construct()
return implode("\n", $code);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityConstructor(ClassMetadataInfo $metadata)
{
if ($this->hasMethod('__construct', $metadata)) {
@@ -588,7 +641,10 @@ public function __construct()
/**
* @todo this won't work if there is a namespace in brackets and a class outside of it.
+ *
* @param string $src
+ *
+ * @return void
*/
protected function parseTokensInEntityFile($src)
{
@@ -637,6 +693,12 @@ public function __construct()
}
}
+ /**
+ * @param string $property
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return bool
+ */
protected function hasProperty($property, ClassMetadataInfo $metadata)
{
if ($this->extendsClass()) {
@@ -653,6 +715,12 @@ public function __construct()
);
}
+ /**
+ * @param string $method
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return bool
+ */
protected function hasMethod($method, ClassMetadataInfo $metadata)
{
if ($this->extendsClass()) {
@@ -670,21 +738,35 @@ public function __construct()
);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return bool
+ */
protected function hasNamespace(ClassMetadataInfo $metadata)
{
return strpos($metadata->name, '\\') ? true : false;
}
+ /**
+ * @return bool
+ */
protected function extendsClass()
{
return $this->classToExtend ? true : false;
}
+ /**
+ * @return string
+ */
protected function getClassToExtend()
{
return $this->classToExtend;
}
+ /**
+ * @return string
+ */
protected function getClassToExtendName()
{
$refl = new \ReflectionClass($this->getClassToExtend());
@@ -692,17 +774,32 @@ public function __construct()
return '\\' . $refl->getName();
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function getClassName(ClassMetadataInfo $metadata)
{
return ($pos = strrpos($metadata->name, '\\'))
? substr($metadata->name, $pos + 1, strlen($metadata->name)) : $metadata->name;
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function getNamespace(ClassMetadataInfo $metadata)
{
return substr($metadata->name, 0, strrpos($metadata->name, '\\'));
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityDocBlock(ClassMetadataInfo $metadata)
{
$lines = array();
@@ -745,6 +842,11 @@ public function __construct()
return implode("\n", $lines);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateTableAnnotation($metadata)
{
$table = array();
@@ -770,6 +872,12 @@ public function __construct()
return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
}
+ /**
+ * @param string $constraintName
+ * @param array $constraints
+ *
+ * @return string
+ */
protected function generateTableConstraints($constraintName, $constraints)
{
$annotations = array();
@@ -783,6 +891,11 @@ public function __construct()
return implode(', ', $annotations);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateInheritanceAnnotation($metadata)
{
if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
@@ -790,6 +903,11 @@ public function __construct()
}
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateDiscriminatorColumnAnnotation($metadata)
{
if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
@@ -802,6 +920,11 @@ public function __construct()
}
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateDiscriminatorMapAnnotation($metadata)
{
if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) {
@@ -815,6 +938,11 @@ public function __construct()
}
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityStubMethods(ClassMetadataInfo $metadata)
{
$methods = array();
@@ -856,6 +984,11 @@ public function __construct()
return implode("\n\n", $methods);
}
+ /**
+ * @param array $associationMapping
+ *
+ * @return bool
+ */
protected function isAssociationIsNullable($associationMapping)
{
if (isset($associationMapping['id']) && $associationMapping['id']) {
@@ -878,6 +1011,11 @@ public function __construct()
return true;
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityLifecycleCallbackMethods(ClassMetadataInfo $metadata)
{
if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
@@ -897,6 +1035,11 @@ public function __construct()
return "";
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityAssociationMappingProperties(ClassMetadataInfo $metadata)
{
$lines = array();
@@ -914,6 +1057,11 @@ public function __construct()
return implode("\n", $lines);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateEntityFieldMappingProperties(ClassMetadataInfo $metadata)
{
$lines = array();
@@ -932,6 +1080,15 @@ public function __construct()
return implode("\n", $lines);
}
+ /**
+ * @param ClassMetadataInfo $metadata
+ * @param string $type
+ * @param string $fieldName
+ * @param string|null $typeHint
+ * @param string|null $defaultValue
+ *
+ * @return string
+ */
protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
{
$methodName = $type . Inflector::classify($fieldName);
@@ -976,6 +1133,13 @@ public function __construct()
return $this->prefixCodeWithSpaces($method);
}
+ /**
+ * @param string $name
+ * @param string $methodName
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateLifecycleCallbackMethod($name, $methodName, $metadata)
{
if ($this->hasMethod($methodName, $metadata)) {
@@ -997,6 +1161,11 @@ public function __construct()
return $this->prefixCodeWithSpaces($method);
}
+ /**
+ * @param array $joinColumn
+ *
+ * @return string
+ */
protected function generateJoinColumnAnnotation(array $joinColumn)
{
$joinColumnAnnot = array();
@@ -1028,6 +1197,12 @@ public function __construct()
return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
}
+ /**
+ * @param array $associationMapping
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata)
{
$lines = array();
@@ -1165,6 +1340,12 @@ public function __construct()
return implode("\n", $lines);
}
+ /**
+ * @param array $fieldMapping
+ * @param ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata)
{
$lines = array();
@@ -1245,6 +1426,12 @@ public function __construct()
return implode("\n", $lines);
}
+ /**
+ * @param string $code
+ * @param int $num
+ *
+ * @return string
+ */
protected function prefixCodeWithSpaces($code, $num = 1)
{
$lines = explode("\n", $code);
@@ -1259,9 +1446,11 @@ public function __construct()
}
/**
- * @param integer $type The inheritance type used by the class and it's subclasses.
- * @return string The literal string for the inheritance type.
- * @throws \InvalidArgumentException When the inheritance type does not exists.
+ * @param integer $type The inheritance type used by the class and its subclasses.
+ *
+ * @return string The literal string for the inheritance type.
+ *
+ * @throws \InvalidArgumentException When the inheritance type does not exists.
*/
protected function getInheritanceTypeString($type)
{
@@ -1273,9 +1462,11 @@ public function __construct()
}
/**
- * @param integer $type The policy used for change-tracking for the mapped class.
- * @return string The literal string for the change-tracking type.
- * @throws \InvalidArgumentException When the change-tracking type does not exists.
+ * @param integer $type The policy used for change-tracking for the mapped class.
+ *
+ * @return string The literal string for the change-tracking type.
+ *
+ * @throws \InvalidArgumentException When the change-tracking type does not exists.
*/
protected function getChangeTrackingPolicyString($type)
{
@@ -1287,8 +1478,10 @@ public function __construct()
}
/**
- * @param integer $type The generator to use for the mapped class.
- * @return string The literal string for the generetor type.
+ * @param integer $type The generator to use for the mapped class.
+ *
+ * @return string The literal string for the generetor type.
+ *
* @throws \InvalidArgumentException When the generator type does not exists.
*/
protected function getIdGeneratorTypeString($type)
diff --git a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php
index ea9ee10bc..5093cd54d 100644
--- a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php
+++ b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php
@@ -50,6 +50,11 @@ class extends EntityRepository
}
';
+ /**
+ * @param string $fullClassName
+ *
+ * @return string
+ */
public function generateEntityRepositoryClass($fullClassName)
{
$className = substr($fullClassName, strrpos($fullClassName, '\\') + 1, strlen($fullClassName));
@@ -63,9 +68,10 @@ class extends EntityRepository
}
/**
- * Generate the namespace statement, if class do not have namespace, return empty string instead
+ * Generates the namespace statement, if class do not have namespace, return empty string instead.
*
- * @param string $fullClassName The full repository class name
+ * @param string $fullClassName The full repository class name.
+ *
* @return string $namespace
*/
private function generateEntityRepositoryNamespace($fullClassName)
@@ -74,7 +80,13 @@ class extends EntityRepository
return $namespace ? 'namespace ' . $namespace . ';' : '';
}
-
+
+ /**
+ * @param string $fullClassName
+ * @param string $outputDirectory
+ *
+ * @return void
+ */
public function writeEntityRepositoryClass($fullClassName, $outputDirectory)
{
$code = $this->generateEntityRepositoryClass($fullClassName);
diff --git a/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php b/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php
index ffa5d022c..36455621c 100644
--- a/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php
+++ b/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php
@@ -33,7 +33,14 @@ use Doctrine\ORM\EntityManager;
*/
class GenerateSchemaEventArgs extends EventArgs
{
+ /**
+ * @var \Doctrine\ORM\EntityManager
+ */
private $em;
+
+ /**
+ * @var \Doctrine\DBAL\Schema\Schema
+ */
private $schema;
/**
diff --git a/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php b/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php
index d786e9a73..9e68ae6e9 100644
--- a/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php
+++ b/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php
@@ -33,8 +33,19 @@ use Doctrine\DBAL\Schema\Table;
*/
class GenerateSchemaTableEventArgs extends EventArgs
{
+ /**
+ * @var \Doctrine\ORM\Mapping\ClassMetadata
+ */
private $classMetadata;
+
+ /**
+ * @var \Doctrine\DBAL\Schema\Schema
+ */
private $schema;
+
+ /**
+ * @var \Doctrine\DBAL\Schema\Table
+ */
private $classTable;
/**
diff --git a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php
index 9c627f265..478ae8473 100644
--- a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php
@@ -31,6 +31,9 @@ use Doctrine\ORM\Tools\Export\ExportException;
*/
class ClassMetadataExporter
{
+ /**
+ * @var array
+ */
private static $_exporterDrivers = array(
'xml' => 'Doctrine\ORM\Tools\Export\Driver\XmlExporter',
'yaml' => 'Doctrine\ORM\Tools\Export\Driver\YamlExporter',
@@ -40,10 +43,12 @@ class ClassMetadataExporter
);
/**
- * Register a new exporter driver class under a specified name
+ * Registers a new exporter driver class under a specified name.
*
* @param string $name
* @param string $class
+ *
+ * @return void
*/
public static function registerExportDriver($name, $class)
{
@@ -51,12 +56,14 @@ class ClassMetadataExporter
}
/**
- * Get a exporter driver instance
+ * Gets an exporter driver instance.
*
- * @param string $type The type to get (yml, xml, etc.)
- * @param string $source The directory where the exporter will export to
+ * @param string $type The type to get (yml, xml, etc.).
+ * @param string|null $dest The directory where the exporter will export to.
*
- * @return Driver\AbstractExporter $exporter
+ * @return Driver\AbstractExporter
+ *
+ * @throws ExportException
*/
public function getExporter($type, $dest = null)
{
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php
index ab11eae16..65169124c 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php
@@ -24,8 +24,7 @@ use Doctrine\ORM\Tools\Export\ExportException;
/**
* Abstract base class which is to be used for the Exporter drivers
- * which can be found in \Doctrine\ORM\Tools\Export\Driver
- *
+ * which can be found in \Doctrine\ORM\Tools\Export\Driver.
*
* @link www.doctrine-project.org
* @since 2.0
@@ -33,16 +32,39 @@ use Doctrine\ORM\Tools\Export\ExportException;
*/
abstract class AbstractExporter
{
+ /**
+ * @var array
+ */
protected $_metadata = array();
+
+ /**
+ * @var string|null
+ */
protected $_outputDir;
+
+ /**
+ * @var string|null
+ */
protected $_extension;
+
+ /**
+ * @var bool
+ */
protected $_overwriteExistingFiles = false;
+ /**
+ * @param string|null $dir
+ */
public function __construct($dir = null)
{
$this->_outputDir = $dir;
}
+ /**
+ * @param bool $overwrite
+ *
+ * @return void
+ */
public function setOverwriteExistingFiles($overwrite)
{
$this->_overwriteExistingFiles = $overwrite;
@@ -50,17 +72,19 @@ abstract class AbstractExporter
/**
* Converts a single ClassMetadata instance to the exported format
- * and returns it
+ * and returns it.
*
* @param ClassMetadataInfo $metadata
- * @return mixed $exported
+ *
+ * @return string
*/
abstract public function exportClassMetadata(ClassMetadataInfo $metadata);
/**
- * Set the array of ClassMetadataInfo instances to export
+ * Sets the array of ClassMetadataInfo instances to export.
*
* @param array $metadata
+ *
* @return void
*/
public function setMetadata(array $metadata)
@@ -69,9 +93,9 @@ abstract class AbstractExporter
}
/**
- * Get the extension used to generated the path to a class
+ * Gets the extension used to generated the path to a class.
*
- * @return string $extension
+ * @return string|null
*/
public function getExtension()
{
@@ -79,7 +103,7 @@ abstract class AbstractExporter
}
/**
- * Set the directory to output the mapping files to
+ * Sets the directory to output the mapping files to.
*
* [php]
* $exporter = new YamlExporter($metadata);
@@ -87,6 +111,7 @@ abstract class AbstractExporter
* $exporter->export();
*
* @param string $dir
+ *
* @return void
*/
public function setOutputDir($dir)
@@ -95,10 +120,12 @@ abstract class AbstractExporter
}
/**
- * Export each ClassMetadata instance to a single Doctrine Mapping file
- * named after the entity
+ * Exports each ClassMetadata instance to a single Doctrine Mapping file
+ * named after the entity.
*
* @return void
+ *
+ * @throws \Doctrine\ORM\Tools\Export\ExportException
*/
public function export()
{
@@ -123,10 +150,11 @@ abstract class AbstractExporter
}
/**
- * Generate the path to write the class for the given ClassMetadataInfo instance
+ * Generates the path to write the class for the given ClassMetadataInfo instance.
*
* @param ClassMetadataInfo $metadata
- * @return string $path
+ *
+ * @return string
*/
protected function _generateOutputPath(ClassMetadataInfo $metadata)
{
@@ -134,7 +162,7 @@ abstract class AbstractExporter
}
/**
- * Set the directory to output the mapping files to
+ * Sets the directory to output the mapping files to.
*
* [php]
* $exporter = new YamlExporter($metadata, __DIR__ . '/yaml');
@@ -142,6 +170,7 @@ abstract class AbstractExporter
* $exporter->export();
*
* @param string $extension
+ *
* @return void
*/
public function setExtension($extension)
@@ -149,6 +178,11 @@ abstract class AbstractExporter
$this->_extension = $extension;
}
+ /**
+ * @param int $type
+ *
+ * @return string
+ */
protected function _getInheritanceTypeString($type)
{
switch ($type) {
@@ -166,6 +200,11 @@ abstract class AbstractExporter
}
}
+ /**
+ * @param int $policy
+ *
+ * @return string
+ */
protected function _getChangeTrackingPolicyString($policy)
{
switch ($policy) {
@@ -180,6 +219,11 @@ abstract class AbstractExporter
}
}
+ /**
+ * @param int $type
+ *
+ * @return string
+ */
protected function _getIdGeneratorTypeString($type)
{
switch ($type) {
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php
index 439fd5c58..044a1da53 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php
@@ -23,8 +23,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Tools\EntityGenerator;
/**
- * ClassMetadata exporter for PHP classes with annotations
- *
+ * ClassMetadata exporter for PHP classes with annotations.
*
* @link www.doctrine-project.org
* @since 2.0
@@ -32,15 +31,18 @@ use Doctrine\ORM\Tools\EntityGenerator;
*/
class AnnotationExporter extends AbstractExporter
{
+ /**
+ * @var string
+ */
protected $_extension = '.php';
+
+ /**
+ * @var EntityGenerator|null
+ */
private $_entityGenerator;
/**
- * Converts a single ClassMetadata instance to the exported format
- * and returns it
- *
- * @param ClassMetadataInfo $metadata
- * @return string $exported
+ * {@inheritdoc}
*/
public function exportClassMetadata(ClassMetadataInfo $metadata)
{
@@ -56,11 +58,21 @@ class AnnotationExporter extends AbstractExporter
return $this->_entityGenerator->generateEntityClass($metadata);
}
+ /**
+ * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
+ *
+ * @return string
+ */
protected function _generateOutputPath(ClassMetadataInfo $metadata)
{
return $this->_outputDir . '/' . str_replace('\\', '/', $metadata->name) . $this->_extension;
}
+ /**
+ * @param \Doctrine\ORM\Tools\EntityGenerator $entityGenerator
+ *
+ * @return void
+ */
public function setEntityGenerator(EntityGenerator $entityGenerator)
{
$this->_entityGenerator = $entityGenerator;
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
index bfb861cfb..778c30f49 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
@@ -22,8 +22,7 @@ namespace Doctrine\ORM\Tools\Export\Driver;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
/**
- * ClassMetadata exporter for PHP code
- *
+ * ClassMetadata exporter for PHP code.
*
* @link www.doctrine-project.org
* @since 2.0
@@ -31,14 +30,13 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
*/
class PhpExporter extends AbstractExporter
{
+ /**
+ * @var string
+ */
protected $_extension = '.php';
/**
- * Converts a single ClassMetadata instance to the exported format
- * and returns it
- *
- * @param ClassMetadataInfo $metadata
- * @return mixed $exported
+ * {@inheritdoc}
*/
public function exportClassMetadata(ClassMetadataInfo $metadata)
{
@@ -154,6 +152,11 @@ class PhpExporter extends AbstractExporter
return implode("\n", $lines);
}
+ /**
+ * @param mixed $var
+ *
+ * @return string
+ */
protected function _varExport($var)
{
$export = var_export($var, true);
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
index 57bf558a4..2d9cb4d3c 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
@@ -22,7 +22,7 @@ namespace Doctrine\ORM\Tools\Export\Driver;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
/**
- * ClassMetadata exporter for Doctrine XML mapping files
+ * ClassMetadata exporter for Doctrine XML mapping files.
*
* @link www.doctrine-project.org
* @since 2.0
@@ -30,14 +30,13 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
*/
class XmlExporter extends AbstractExporter
{
+ /**
+ * @var string
+ */
protected $_extension = '.dcm.xml';
/**
- * Converts a single ClassMetadata instance to the exported format
- * and returns it
- *
- * @param ClassMetadataInfo $metadata
- * @return mixed $exported
+ * {@inheritdoc}
*/
public function exportClassMetadata(ClassMetadataInfo $metadata)
{
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
index 39c89dd43..ab5e5f968 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
@@ -23,8 +23,7 @@ use Symfony\Component\Yaml\Yaml;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
/**
- * ClassMetadata exporter for Doctrine YAML mapping files
- *
+ * ClassMetadata exporter for Doctrine YAML mapping files.
*
* @link www.doctrine-project.org
* @since 2.0
@@ -32,16 +31,13 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
*/
class YamlExporter extends AbstractExporter
{
+ /**
+ * @var string
+ */
protected $_extension = '.dcm.yml';
/**
- * Converts a single ClassMetadata instance to the exported format
- * and returns it
- *
- * TODO: Should this code be pulled out in to a toArray() method in ClassMetadata
- *
- * @param ClassMetadataInfo $metadata
- * @return mixed $exported
+ * {@inheritdoc}
*/
public function exportClassMetadata(ClassMetadataInfo $metadata)
{
diff --git a/lib/Doctrine/ORM/Tools/Export/ExportException.php b/lib/Doctrine/ORM/Tools/Export/ExportException.php
index 5ba8bd26b..89ddfe22e 100644
--- a/lib/Doctrine/ORM/Tools/Export/ExportException.php
+++ b/lib/Doctrine/ORM/Tools/Export/ExportException.php
@@ -6,16 +6,31 @@ use Doctrine\ORM\ORMException;
class ExportException extends ORMException
{
+ /**
+ * @param string $type
+ *
+ * @return ExportException
+ */
public static function invalidExporterDriverType($type)
{
return new self("The specified export driver '$type' does not exist");
}
+ /**
+ * @param string $type
+ *
+ * @return ExportException
+ */
public static function invalidMappingDriverType($type)
{
return new self("The mapping driver '$type' does not exist");
}
+ /**
+ * @param string $file
+ *
+ * @return ExportException
+ */
public static function attemptOverwriteExistingFile($file)
{
return new self("Attempting to overwrite an existing file '".$file."'.");
diff --git a/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php
index 32d573ec6..401898011 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php
@@ -17,7 +17,7 @@ use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\AST\SelectStatement;
/**
- * Wrap the query in order to accurately count the root objects
+ * Wraps the query in order to accurately count the root objects.
*
* Given a DQL like `SELECT u FROM User u` it will generate an SQL query like:
* SELECT COUNT(*) (SELECT DISTINCT FROM ())
@@ -45,13 +45,15 @@ class CountOutputWalker extends SqlWalker
private $queryComponents;
/**
- * Constructor. Stores various parameters that are otherwise unavailable
+ * Constructor.
+ *
+ * Stores various parameters that are otherwise unavailable
* because Doctrine\ORM\Query\SqlWalker keeps everything private without
* accessors.
*
- * @param \Doctrine\ORM\Query $query
+ * @param \Doctrine\ORM\Query $query
* @param \Doctrine\ORM\Query\ParserResult $parserResult
- * @param array $queryComponents
+ * @param array $queryComponents
*/
public function __construct($query, $parserResult, array $queryComponents)
{
@@ -63,14 +65,17 @@ class CountOutputWalker extends SqlWalker
}
/**
- * Walks down a SelectStatement AST node, wrapping it in a COUNT (SELECT DISTINCT)
+ * Walks down a SelectStatement AST node, wrapping it in a COUNT (SELECT DISTINCT).
*
* Note that the ORDER BY clause is not removed. Many SQL implementations (e.g. MySQL)
* are able to cache subqueries. By keeping the ORDER BY clause intact, the limitSubQuery
* that will most likely be executed next can be read from the native SQL cache.
*
* @param SelectStatement $AST
+ *
* @return string
+ *
+ * @throws \RuntimeException
*/
public function walkSelectStatement(SelectStatement $AST)
{
diff --git a/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php b/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php
index 578d13aee..778dd3072 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php
@@ -20,7 +20,7 @@ use Doctrine\ORM\Query\AST\PathExpression;
use Doctrine\ORM\Query\AST\AggregateExpression;
/**
- * Replaces the selectClause of the AST with a COUNT statement
+ * Replaces the selectClause of the AST with a COUNT statement.
*
* @category DoctrineExtensions
* @package DoctrineExtensions\Paginate
@@ -31,15 +31,18 @@ use Doctrine\ORM\Query\AST\AggregateExpression;
class CountWalker extends TreeWalkerAdapter
{
/**
- * Distinct mode hint name
+ * Distinct mode hint name.
*/
const HINT_DISTINCT = 'doctrine_paginator.distinct';
/**
- * Walks down a SelectStatement AST node, modifying it to retrieve a COUNT
+ * Walks down a SelectStatement AST node, modifying it to retrieve a COUNT.
*
* @param SelectStatement $AST
+ *
* @return void
+ *
+ * @throws \RuntimeException
*/
public function walkSelectStatement(SelectStatement $AST)
{
diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
index a3e1df2dc..a0ccc982d 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
@@ -18,7 +18,7 @@ use Doctrine\ORM\Query\AST\SelectStatement;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
/**
- * Wrap the query in order to select root entity IDs for pagination
+ * Wraps the query in order to select root entity IDs for pagination.
*
* Given a DQL like `SELECT u FROM User u` it will generate an SQL query like:
* SELECT DISTINCT FROM () LIMIT x OFFSET y
@@ -56,13 +56,15 @@ class LimitSubqueryOutputWalker extends SqlWalker
private $maxResults;
/**
- * Constructor. Stores various parameters that are otherwise unavailable
+ * Constructor.
+ *
+ * Stores various parameters that are otherwise unavailable
* because Doctrine\ORM\Query\SqlWalker keeps everything private without
* accessors.
*
- * @param \Doctrine\ORM\Query $query
+ * @param \Doctrine\ORM\Query $query
* @param \Doctrine\ORM\Query\ParserResult $parserResult
- * @param array $queryComponents
+ * @param array $queryComponents
*/
public function __construct($query, $parserResult, array $queryComponents)
{
@@ -79,21 +81,24 @@ class LimitSubqueryOutputWalker extends SqlWalker
}
/**
- * Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT
+ * Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
*
* @param SelectStatement $AST
+ *
* @return string
+ *
+ * @throws \RuntimeException
*/
public function walkSelectStatement(SelectStatement $AST)
{
$innerSql = parent::walkSelectStatement($AST);
- // Find out the SQL alias of the identifier column of the root entity
+ // Find out the SQL alias of the identifier column of the root entity.
// It may be possible to make this work with multiple root entities but that
- // would probably require issuing multiple queries or doing a UNION SELECT
- // so for now, It's not supported.
+ // would probably require issuing multiple queries or doing a UNION SELECT.
+ // So for now, it's not supported.
- // Get the root entity and alias from the AST fromClause
+ // Get the root entity and alias from the AST fromClause.
$from = $AST->fromClause->identificationVariableDeclarations;
if (count($from) !== 1) {
throw new \RuntimeException("Cannot count query which selects two FROM components, cannot make distinction");
@@ -132,7 +137,7 @@ class LimitSubqueryOutputWalker extends SqlWalker
));
}
- // Build the counter query
+ // Build the counter query.
$sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result',
implode(', ', $sqlIdentifier), $innerSql);
@@ -141,7 +146,7 @@ class LimitSubqueryOutputWalker extends SqlWalker
$this->getPostgresqlSql($AST, $sqlIdentifier, $innerSql, $sql);
}
- // Apply the limit and offset
+ // Apply the limit and offset.
$sql = $this->platform->modifyLimitQuery(
$sql, $this->maxResults, $this->firstResult
);
@@ -158,15 +163,18 @@ class LimitSubqueryOutputWalker extends SqlWalker
}
/**
- * Generate new SQL for postgresql if necessary
+ * Generates new SQL for postgresql if necessary.
*
* @param SelectStatement $AST
- * @param array sqlIdentifier
+ * @param array $sqlIdentifier
+ * @param string $innerSql
* @param string $sql
+ *
+ * @return void
*/
public function getPostgresqlSql(SelectStatement $AST, array $sqlIdentifier, $innerSql, &$sql)
{
- // For every order by, find out the SQL alias by inspecting the ResultSetMapping
+ // For every order by, find out the SQL alias by inspecting the ResultSetMapping.
$sqlOrderColumns = array();
$orderBy = array();
if (isset($AST->orderByClause)) {
@@ -185,8 +193,8 @@ class LimitSubqueryOutputWalker extends SqlWalker
$sqlOrderColumns = array_diff($sqlOrderColumns, $sqlIdentifier);
}
- //we don't need orderBy in inner query
- //However at least on 5.4.6 I'm getting a segmentation fault and thus we don't clear it for now
+ // We don't need orderBy in inner query.
+ // However at least on 5.4.6 I'm getting a segmentation fault and thus we don't clear it for now.
/*$AST->orderByClause = null;
$innerSql = parent::walkSelectStatement($AST);*/
diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php
index 545f983af..ca3f1032c 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php
@@ -23,10 +23,9 @@ use Doctrine\ORM\Query\TreeWalkerAdapter;
use Doctrine\ORM\Query\AST\SelectStatement;
use Doctrine\ORM\Query\AST\SelectExpression;
use Doctrine\ORM\Query\AST\PathExpression;
-use Doctrine\ORM\Query\AST\AggregateExpression;
/**
- * Replaces the selectClause of the AST with a SELECT DISTINCT root.id equivalent
+ * Replaces the selectClause of the AST with a SELECT DISTINCT root.id equivalent.
*
* @category DoctrineExtensions
* @package DoctrineExtensions\Paginate
@@ -37,21 +36,26 @@ use Doctrine\ORM\Query\AST\AggregateExpression;
class LimitSubqueryWalker extends TreeWalkerAdapter
{
/**
- * ID type hint
+ * ID type hint.
*/
const IDENTIFIER_TYPE = 'doctrine_paginator.id.type';
/**
- * @var int Counter for generating unique order column aliases
+ * Counter for generating unique order column aliases.
+ *
+ * @var int
*/
private $_aliasCounter = 0;
/**
* Walks down a SelectStatement AST node, modifying it to retrieve DISTINCT ids
- * of the root Entity
+ * of the root Entity.
*
* @param SelectStatement $AST
+ *
* @return void
+ *
+ * @throws \RuntimeException
*/
public function walkSelectStatement(SelectStatement $AST)
{
@@ -60,7 +64,7 @@ class LimitSubqueryWalker extends TreeWalkerAdapter
$selectExpressions = array();
foreach ($this->_getQueryComponents() as $dqlAlias => $qComp) {
- // preserve mixed data in query for ordering
+ // Preserve mixed data in query for ordering.
if (isset($qComp['resultVariable'])) {
$selectExpressions[] = new SelectExpression($qComp['resultVariable'], $dqlAlias);
continue;
@@ -112,8 +116,4 @@ class LimitSubqueryWalker extends TreeWalkerAdapter
$AST->selectClause->isDistinct = true;
}
-
}
-
-
-
diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php
index eaabd8879..115eb590e 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php
@@ -25,8 +25,6 @@ use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\NoResultException;
/**
- * Paginator
- *
* The paginator can handle various complex scenarios with DQL.
*
* @author Pablo DÃez
@@ -58,8 +56,8 @@ class Paginator implements \Countable, \IteratorAggregate
/**
* Constructor.
*
- * @param Query|QueryBuilder $query A Doctrine ORM query or query builder.
- * @param Boolean $fetchJoinCollection Whether the query joins a collection (true by default).
+ * @param Query|QueryBuilder $query A Doctrine ORM query or query builder.
+ * @param boolean $fetchJoinCollection Whether the query joins a collection (true by default).
*/
public function __construct($query, $fetchJoinCollection = true)
{
@@ -72,7 +70,7 @@ class Paginator implements \Countable, \IteratorAggregate
}
/**
- * Returns the query
+ * Returns the query.
*
* @return Query
*/
@@ -84,7 +82,7 @@ class Paginator implements \Countable, \IteratorAggregate
/**
* Returns whether the query joins a collection.
*
- * @return Boolean Whether the query joins a collection.
+ * @return boolean Whether the query joins a collection.
*/
public function getFetchJoinCollection()
{
@@ -92,7 +90,7 @@ class Paginator implements \Countable, \IteratorAggregate
}
/**
- * Returns whether the paginator will use an output walker
+ * Returns whether the paginator will use an output walker.
*
* @return bool|null
*/
@@ -102,9 +100,10 @@ class Paginator implements \Countable, \IteratorAggregate
}
/**
- * Set whether the paginator will use an output walker
+ * Sets whether the paginator will use an output walker.
*
* @param bool|null $useOutputWalkers
+ *
* @return $this
*/
public function setUseOutputWalkers($useOutputWalkers)
@@ -218,7 +217,7 @@ class Paginator implements \Countable, \IteratorAggregate
}
/**
- * Determine whether to use an output walker for the query
+ * Determines whether to use an output walker for the query.
*
* @param Query $query The query.
*
@@ -233,4 +232,3 @@ class Paginator implements \Countable, \IteratorAggregate
return $this->useOutputWalkers;
}
}
-
diff --git a/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php b/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php
index 9f41ae6af..27cbc3c2e 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php
@@ -32,7 +32,7 @@ use Doctrine\ORM\Query\AST\ConditionalFactor;
use Doctrine\ORM\Query\AST\WhereClause;
/**
- * Replaces the whereClause of the AST with a WHERE id IN (:foo_1, :foo_2) equivalent
+ * Replaces the whereClause of the AST with a WHERE id IN (:foo_1, :foo_2) equivalent.
*
* @category DoctrineExtensions
* @package DoctrineExtensions\Paginate
@@ -43,17 +43,17 @@ use Doctrine\ORM\Query\AST\WhereClause;
class WhereInWalker extends TreeWalkerAdapter
{
/**
- * ID Count hint name
+ * ID Count hint name.
*/
const HINT_PAGINATOR_ID_COUNT = 'doctrine.id.count';
/**
- * Primary key alias for query
+ * Primary key alias for query.
*/
const PAGINATOR_ID_ALIAS = 'dpid';
/**
- * Replaces the whereClause in the AST
+ * Replaces the whereClause in the AST.
*
* Generates a clause equivalent to WHERE IN (:dpid_1, :dpid_2, ...)
*
@@ -61,10 +61,13 @@ class WhereInWalker extends TreeWalkerAdapter
* the PAGINATOR_ID_ALIAS
*
* The total number of parameters is retrieved from
- * the HINT_PAGINATOR_ID_COUNT query hint
+ * the HINT_PAGINATOR_ID_COUNT query hint.
+ *
+ * @param SelectStatement $AST
*
- * @param SelectStatement $AST
* @return void
+ *
+ * @throws \RuntimeException
*/
public function walkSelectStatement(SelectStatement $AST)
{
@@ -142,4 +145,3 @@ class WhereInWalker extends TreeWalkerAdapter
}
}
}
-
diff --git a/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php b/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php
index edbaa4568..e193ae2e3 100644
--- a/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php
+++ b/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php
@@ -39,11 +39,12 @@ class ResolveTargetEntityListener
private $resolveTargetEntities = array();
/**
- * Add a target-entity class name to resolve to a new class name.
+ * Adds a target-entity class name to resolve to a new class name.
*
* @param string $originalEntity
* @param string $newEntity
- * @param array $mapping
+ * @param array $mapping
+ *
* @return void
*/
public function addResolveTargetEntity($originalEntity, $newEntity, array $mapping)
@@ -53,9 +54,10 @@ class ResolveTargetEntityListener
}
/**
- * Process event and resolve new target entity names.
+ * Processes event and resolves new target entity names.
*
* @param LoadClassMetadataEventArgs $args
+ *
* @return void
*/
public function loadClassMetadata(LoadClassMetadataEventArgs $args)
@@ -69,6 +71,12 @@ class ResolveTargetEntityListener
}
}
+ /**
+ * @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata
+ * @param array $mapping
+ *
+ * @return void
+ */
private function remapAssociation($classMetadata, $mapping)
{
$newMapping = $this->resolveTargetEntities[$mapping['targetEntity']];
@@ -93,4 +101,3 @@ class ResolveTargetEntityListener
}
}
}
-
diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php
index 6a5319b1c..02ef1e7c7 100644
--- a/lib/Doctrine/ORM/Tools/SchemaTool.php
+++ b/lib/Doctrine/ORM/Tools/SchemaTool.php
@@ -79,9 +79,11 @@ class SchemaTool
/**
* Creates the database schema for the given array of ClassMetadata instances.
*
- * @throws ToolsException
* @param array $classes
+ *
* @return void
+ *
+ * @throws ToolsException
*/
public function createSchema(array $classes)
{
@@ -102,7 +104,8 @@ class SchemaTool
* the given list of ClassMetadata instances.
*
* @param array $classes
- * @return array $sql The SQL statements needed to create the schema for the classes.
+ *
+ * @return array The SQL statements needed to create the schema for the classes.
*/
public function getCreateSchemaSql(array $classes)
{
@@ -111,10 +114,11 @@ class SchemaTool
}
/**
- * Some instances of ClassMetadata don't need to be processed in the SchemaTool context. This method detects them.
+ * Detects instances of ClassMetadata that don't need to be processed in the SchemaTool context.
*
* @param ClassMetadata $class
- * @param array $processedClasses
+ * @param array $processedClasses
+ *
* @return bool
*/
private function processingNotRequired($class, array $processedClasses)
@@ -127,10 +131,13 @@ class SchemaTool
}
/**
- * From a given set of metadata classes this method creates a Schema instance.
+ * Creates a Schema instance from a given set of metadata classes.
*
* @param array $classes
+ *
* @return Schema
+ *
+ * @throws \Doctrine\ORM\ORMException
*/
public function getSchemaFromMetadata(array $classes)
{
@@ -288,9 +295,10 @@ class SchemaTool
* column of a class.
*
* @param ClassMetadata $class
- * @param Table $table
+ * @param Table $table
+ *
* @return array The portable column definition of the discriminator column as required by
- * the DBAL.
+ * the DBAL.
*/
private function addDiscriminatorColumnDefinition($class, Table $table)
{
@@ -318,7 +326,8 @@ class SchemaTool
* found in the given class.
*
* @param ClassMetadata $class
- * @param Table $table
+ * @param Table $table
+ *
* @return array The list of portable column definitions as required by the DBAL.
*/
private function gatherColumns($class, Table $table)
@@ -347,9 +356,10 @@ class SchemaTool
/**
* Creates a column definition as required by the DBAL from an ORM field mapping definition.
*
- * @param ClassMetadata $class The class that owns the field mapping.
- * @param array $mapping The field mapping.
- * @param Table $table
+ * @param ClassMetadata $class The class that owns the field mapping.
+ * @param array $mapping The field mapping.
+ * @param Table $table
+ *
* @return array The portable column definition as required by the DBAL.
*/
private function gatherColumn($class, array $mapping, Table $table)
@@ -434,11 +444,14 @@ class SchemaTool
* This includes the SQL for foreign key constraints and join tables.
*
* @param ClassMetadata $class
- * @param \Doctrine\DBAL\Schema\Table $table
- * @param \Doctrine\DBAL\Schema\Schema $schema
- * @param array $addedFks
- * @param array $blacklistedFks
+ * @param Table $table
+ * @param Schema $schema
+ * @param array $addedFks
+ * @param array $blacklistedFks
+ *
* @return void
+ *
+ * @throws \Doctrine\ORM\ORMException
*/
private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
{
@@ -484,7 +497,7 @@ class SchemaTool
}
/**
- * Get the class metadata that is responsible for the definition of the referenced column name.
+ * Gets the class metadata that is responsible for the definition of the referenced column name.
*
* Previously this was a simple task, but with DDC-117 this problem is actually recursive. If its
* not a simple field, go through all identifier field names that are associations recursivly and
@@ -493,8 +506,9 @@ class SchemaTool
* TODO: Is there any way to make this code more pleasing?
*
* @param ClassMetadata $class
- * @param string $referencedColumnName
- * @return array(ClassMetadata, referencedFieldName)
+ * @param string $referencedColumnName
+ *
+ * @return array (ClassMetadata, referencedFieldName)
*/
private function getDefiningClass($class, $referencedColumnName)
{
@@ -520,16 +534,20 @@ class SchemaTool
}
/**
- * Gather columns and fk constraints that are required for one part of relationship.
+ * Gathers columns and fk constraints that are required for one part of relationship.
*
- * @param array $joinColumns
- * @param \Doctrine\DBAL\Schema\Table $theJoinTable
+ * @param array $joinColumns
+ * @param Table $theJoinTable
* @param ClassMetadata $class
- * @param array $mapping
- * @param array $primaryKeyColumns
- * @param array $uniqueConstraints
- * @param array $addedFks
- * @param array $blacklistedFks
+ * @param array $mapping
+ * @param array $primaryKeyColumns
+ * @param array $uniqueConstraints
+ * @param array $addedFks
+ * @param array $blacklistedFks
+ *
+ * @return void
+ *
+ * @throws \Doctrine\ORM\ORMException
*/
private function _gatherRelationJoinColumns($joinColumns, $theJoinTable, $class, $mapping, &$primaryKeyColumns, &$uniqueConstraints, &$addedFks, &$blacklistedFks)
{
@@ -629,6 +647,7 @@ class SchemaTool
* issued for all classes of the schema and some probably just don't exist.
*
* @param array $classes
+ *
* @return void
*/
public function dropSchema(array $classes)
@@ -677,9 +696,10 @@ class SchemaTool
}
/**
- * Get SQL to drop the tables defined by the passed classes.
+ * Gets SQL to drop the tables defined by the passed classes.
*
* @param array $classes
+ *
* @return array
*/
public function getDropSchemaSQL(array $classes)
@@ -733,8 +753,9 @@ class SchemaTool
* instances to the current database schema that is inspected. If $saveMode is set
* to true the command is executed in the Database, else SQL is returned.
*
- * @param array $classes
+ * @param array $classes
* @param boolean $saveMode
+ *
* @return void
*/
public function updateSchema(array $classes, $saveMode = false)
@@ -753,8 +774,9 @@ class SchemaTool
* If $saveMode is set to true the command is executed in the Database,
* else SQL is returned.
*
- * @param array $classes The classes to consider.
- * @param boolean $saveMode True for writing to DB, false for SQL string
+ * @param array $classes The classes to consider.
+ * @param boolean $saveMode True for writing to DB, false for SQL string.
+ *
* @return array The sequence of SQL statements.
*/
public function getUpdateSchemaSql(array $classes, $saveMode = false)
diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php
index fb1792494..328aeb231 100644
--- a/lib/Doctrine/ORM/Tools/SchemaValidator.php
+++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php
@@ -78,9 +78,10 @@ class SchemaValidator
}
/**
- * Validate a single class of the current
+ * Validates a single class of the current.
*
* @param ClassMetadataInfo $class
+ *
* @return array
*/
public function validateClass(ClassMetadataInfo $class)
@@ -255,7 +256,7 @@ class SchemaValidator
}
/**
- * Check if the Database Schema is in sync with the current metadata state.
+ * Checks if the Database Schema is in sync with the current metadata state.
*
* @return bool
*/
diff --git a/lib/Doctrine/ORM/Tools/Setup.php b/lib/Doctrine/ORM/Tools/Setup.php
index 9894f2005..f24eecebd 100644
--- a/lib/Doctrine/ORM/Tools/Setup.php
+++ b/lib/Doctrine/ORM/Tools/Setup.php
@@ -38,6 +38,7 @@ class Setup
* its github repository at {@link http://github.com/doctrine/doctrine2}
*
* @param string $gitCheckoutRootPath
+ *
* @return void
*/
public static function registerAutoloadGit($gitCheckoutRootPath)
@@ -90,6 +91,8 @@ class Setup
* Pick the directory the library was uncompressed into.
*
* @param string $directory
+ *
+ * @return void
*/
public static function registerAutoloadDirectory($directory)
{
@@ -105,13 +108,14 @@ class Setup
}
/**
- * Create a configuration with an annotation metadata driver.
+ * Creates a configuration with an annotation metadata driver.
*
- * @param array $paths
+ * @param array $paths
* @param boolean $isDevMode
- * @param string $proxyDir
- * @param Cache $cache
- * @param bool $useSimpleAnnotationReader
+ * @param string $proxyDir
+ * @param Cache $cache
+ * @param bool $useSimpleAnnotationReader
+ *
* @return Configuration
*/
public static function createAnnotationMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null, $useSimpleAnnotationReader = true)
@@ -123,12 +127,13 @@ class Setup
}
/**
- * Create a configuration with a xml metadata driver.
+ * Creates a configuration with a xml metadata driver.
*
- * @param array $paths
+ * @param array $paths
* @param boolean $isDevMode
- * @param string $proxyDir
- * @param Cache $cache
+ * @param string $proxyDir
+ * @param Cache $cache
+ *
* @return Configuration
*/
public static function createXMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null)
@@ -140,12 +145,13 @@ class Setup
}
/**
- * Create a configuration with a yaml metadata driver.
+ * Creates a configuration with a yaml metadata driver.
*
- * @param array $paths
+ * @param array $paths
* @param boolean $isDevMode
- * @param string $proxyDir
- * @param Cache $cache
+ * @param string $proxyDir
+ * @param Cache $cache
+ *
* @return Configuration
*/
public static function createYAMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null)
@@ -157,11 +163,12 @@ class Setup
}
/**
- * Create a configuration without a metadata driver.
+ * Creates a configuration without a metadata driver.
*
- * @param bool $isDevMode
+ * @param bool $isDevMode
* @param string $proxyDir
- * @param Cache $cache
+ * @param Cache $cache
+ *
* @return Configuration
*/
public static function createConfiguration($isDevMode = false, $proxyDir = null, Cache $cache = null)
diff --git a/lib/Doctrine/ORM/Tools/ToolsException.php b/lib/Doctrine/ORM/Tools/ToolsException.php
index 30f7ea146..0a4616404 100644
--- a/lib/Doctrine/ORM/Tools/ToolsException.php
+++ b/lib/Doctrine/ORM/Tools/ToolsException.php
@@ -22,17 +22,28 @@ namespace Doctrine\ORM\Tools;
use Doctrine\ORM\ORMException;
/**
- * Tools related Exceptions
+ * Tools related Exceptions.
*
* @author Benjamin Eberlei
*/
class ToolsException extends ORMException
{
+ /**
+ * @param string $sql
+ * @param \Exception $e
+ *
+ * @return ToolsException
+ */
public static function schemaToolFailure($sql, \Exception $e)
{
return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e);
}
+ /**
+ * @param string $type
+ *
+ * @return ToolsException
+ */
public static function couldNotMapDoctrine1Type($type)
{
return new self("Could not map doctrine 1 type '$type'!");
diff --git a/lib/Doctrine/ORM/TransactionRequiredException.php b/lib/Doctrine/ORM/TransactionRequiredException.php
index 3e04224fc..2242e60fb 100644
--- a/lib/Doctrine/ORM/TransactionRequiredException.php
+++ b/lib/Doctrine/ORM/TransactionRequiredException.php
@@ -30,6 +30,9 @@ namespace Doctrine\ORM;
*/
class TransactionRequiredException extends ORMException
{
+ /**
+ * @return TransactionRequiredException
+ */
static public function transactionRequired()
{
return new self('An open transaction is required for this operation.');
diff --git a/lib/Doctrine/ORM/UnexpectedResultException.php b/lib/Doctrine/ORM/UnexpectedResultException.php
index 5d6b6d179..3cd561f09 100644
--- a/lib/Doctrine/ORM/UnexpectedResultException.php
+++ b/lib/Doctrine/ORM/UnexpectedResultException.php
@@ -27,5 +27,4 @@ namespace Doctrine\ORM;
*/
class UnexpectedResultException extends ORMException
{
-
}
diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php
index 0795c3ad0..99c66472c 100644
--- a/lib/Doctrine/ORM/UnitOfWork.php
+++ b/lib/Doctrine/ORM/UnitOfWork.php
@@ -259,9 +259,9 @@ class UnitOfWork implements PropertyChangedListener
*
* @param null|object|array $entity
*
- * @throws \Exception
- *
* @return void
+ *
+ * @throws \Exception
*/
public function commit($entity = null)
{
@@ -373,7 +373,7 @@ class UnitOfWork implements PropertyChangedListener
}
/**
- * Compute the changesets of all entities scheduled for insertion
+ * Computes the changesets of all entities scheduled for insertion.
*
* @return void
*/
@@ -387,18 +387,18 @@ class UnitOfWork implements PropertyChangedListener
}
/**
- * Only flush the given entity according to a ruleset that keeps the UoW consistent.
+ * Only flushes the given entity according to a ruleset that keeps the UoW consistent.
*
* 1. All entities scheduled for insertion, (orphan) removals and changes in collections are processed as well!
* 2. Read Only entities are skipped.
* 3. Proxies are skipped.
* 4. Only if entity is properly managed.
*
- * @param object $entity
- *
- * @throws \InvalidArgumentException
+ * @param object $entity
*
* @return void
+ *
+ * @throws \InvalidArgumentException
*/
private function computeSingleEntityChangeSet($entity)
{
@@ -489,9 +489,13 @@ class UnitOfWork implements PropertyChangedListener
* then this collection is marked for deletion.
*
* @ignore
+ *
* @internal Don't call from the outside.
+ *
* @param ClassMetadata $class The class descriptor of the entity.
* @param object $entity The entity for which to compute the changes.
+ *
+ * @return void
*/
public function computeChangeSet(ClassMetadata $class, $entity)
{
@@ -668,6 +672,8 @@ class UnitOfWork implements PropertyChangedListener
* Computes all the changes that have been done to entities and collections
* since the last commit and stores these changes in the _entityChangeSet map
* temporarily for access by the persisters, until the UoW commit is finished.
+ *
+ * @return void
*/
public function computeChangeSets()
{
@@ -796,7 +802,9 @@ class UnitOfWork implements PropertyChangedListener
/**
* @param ClassMetadata $class
- * @param object $entity
+ * @param object $entity
+ *
+ * @return void
*/
private function persistNew($class, $entity)
{
@@ -839,8 +847,11 @@ class UnitOfWork implements PropertyChangedListener
* whereby changes detected in this method prevail.
*
* @ignore
- * @param ClassMetadata $class The class descriptor of the entity.
- * @param object $entity The entity for which to (re)calculate the change set.
+ *
+ * @param ClassMetadata $class The class descriptor of the entity.
+ * @param object $entity The entity for which to (re)calculate the change set.
+ *
+ * @return void
*
* @throws ORMInvalidArgumentException If the passed entity is not MANAGED.
*/
@@ -895,6 +906,8 @@ class UnitOfWork implements PropertyChangedListener
* Executes all entity insertions for entities of the specified type.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
+ *
+ * @return void
*/
private function executeInserts($class)
{
@@ -952,6 +965,8 @@ class UnitOfWork implements PropertyChangedListener
* Executes all entity updates for entities of the specified type.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
+ *
+ * @return void
*/
private function executeUpdates($class)
{
@@ -1002,6 +1017,8 @@ class UnitOfWork implements PropertyChangedListener
* Executes all entity deletions for entities of the specified type.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
+ *
+ * @return void
*/
private function executeDeletions($class)
{
@@ -1045,7 +1062,7 @@ class UnitOfWork implements PropertyChangedListener
/**
* Gets the commit order.
*
- * @param array $entityChangeSet
+ * @param array|null $entityChangeSet
*
* @return array
*/
@@ -1122,6 +1139,8 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $entity The entity to schedule for insertion.
*
+ * @return void
+ *
* @throws ORMInvalidArgumentException
* @throws \InvalidArgumentException
*/
@@ -1172,6 +1191,8 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $entity The entity to schedule for being updated.
*
+ * @return void
+ *
* @throws ORMInvalidArgumentException
*/
public function scheduleForUpdate($entity)
@@ -1199,8 +1220,11 @@ class UnitOfWork implements PropertyChangedListener
* Extra updates for entities are stored as (entity, changeset) tuples.
*
* @ignore
- * @param object $entity The entity for which to schedule an extra update.
- * @param array $changeset The changeset of the entity (what to update).
+ *
+ * @param object $entity The entity for which to schedule an extra update.
+ * @param array $changeset The changeset of the entity (what to update).
+ *
+ * @return void
*/
public function scheduleExtraUpdate($entity, array $changeset)
{
@@ -1230,7 +1254,6 @@ class UnitOfWork implements PropertyChangedListener
return isset($this->entityUpdates[spl_object_hash($entity)]);
}
-
/**
* Checks whether an entity is registered to be checked in the unit of work.
*
@@ -1250,6 +1273,8 @@ class UnitOfWork implements PropertyChangedListener
* Schedules an entity for deletion.
*
* @param object $entity
+ *
+ * @return void
*/
public function scheduleForDelete($entity)
{
@@ -1297,7 +1322,7 @@ class UnitOfWork implements PropertyChangedListener
/**
* Checks whether an entity is scheduled for insertion, update or deletion.
*
- * @param $entity
+ * @param object $entity
*
* @return boolean
*/
@@ -1317,12 +1342,13 @@ class UnitOfWork implements PropertyChangedListener
* the root entity.
*
* @ignore
+ *
* @param object $entity The entity to register.
*
- * @throws ORMInvalidArgumentException
+ * @return boolean TRUE if the registration was successful, FALSE if the identity of
+ * the entity in question is already managed.
*
- * @return boolean TRUE if the registration was successful, FALSE if the identity of
- * the entity in question is already managed.
+ * @throws ORMInvalidArgumentException
*/
public function addToIdentityMap($entity)
{
@@ -1347,11 +1373,11 @@ class UnitOfWork implements PropertyChangedListener
/**
* Gets the state of an entity with regard to the current unit of work.
*
- * @param object $entity
- * @param integer $assume The state to assume if the state is not yet known (not MANAGED or REMOVED).
- * This parameter can be set to improve performance of entity state detection
- * by potentially avoiding a database lookup if the distinction between NEW and DETACHED
- * is either known or does not matter for the caller of the method.
+ * @param object $entity
+ * @param int|null $assume The state to assume if the state is not yet known (not MANAGED or REMOVED).
+ * This parameter can be set to improve performance of entity state detection
+ * by potentially avoiding a database lookup if the distinction between NEW and DETACHED
+ * is either known or does not matter for the caller of the method.
*
* @return int The entity state.
*/
@@ -1427,11 +1453,12 @@ class UnitOfWork implements PropertyChangedListener
* entity from the persistence management of Doctrine.
*
* @ignore
+ *
* @param object $entity
*
- * @throws ORMInvalidArgumentException
- *
* @return boolean
+ *
+ * @throws ORMInvalidArgumentException
*/
public function removeFromIdentityMap($entity)
{
@@ -1462,6 +1489,7 @@ class UnitOfWork implements PropertyChangedListener
* Gets an entity in the identity map by its identifier hash.
*
* @ignore
+ *
* @param string $idHash
* @param string $rootClassName
*
@@ -1478,10 +1506,11 @@ class UnitOfWork implements PropertyChangedListener
* the given hash, FALSE is returned.
*
* @ignore
+ *
* @param string $idHash
* @param string $rootClassName
*
- * @return mixed The found entity or FALSE.
+ * @return object|bool The found entity or FALSE.
*/
public function tryGetByIdHash($idHash, $rootClassName)
{
@@ -1522,6 +1551,7 @@ class UnitOfWork implements PropertyChangedListener
* Checks whether an identifier hash exists in the identity map.
*
* @ignore
+ *
* @param string $idHash
* @param string $rootClassName
*
@@ -1536,6 +1566,8 @@ class UnitOfWork implements PropertyChangedListener
* Persists an entity as part of the current unit of work.
*
* @param object $entity The entity to persist.
+ *
+ * @return void
*/
public function persist($entity)
{
@@ -1550,8 +1582,10 @@ class UnitOfWork implements PropertyChangedListener
* This method is internally called during persist() cascades as it tracks
* the already visited entities to prevent infinite recursions.
*
- * @param object $entity The entity to persist.
- * @param array $visited The already visited entities.
+ * @param object $entity The entity to persist.
+ * @param array $visited The already visited entities.
+ *
+ * @return void
*
* @throws ORMInvalidArgumentException
* @throws UnexpectedValueException
@@ -1608,6 +1642,8 @@ class UnitOfWork implements PropertyChangedListener
* Deletes an entity as part of the current unit of work.
*
* @param object $entity The entity to remove.
+ *
+ * @return void
*/
public function remove($entity)
{
@@ -1622,8 +1658,10 @@ class UnitOfWork implements PropertyChangedListener
* This method is internally called during delete() cascades as it tracks
* the already visited entities to prevent infinite recursions.
*
- * @param object $entity The entity to delete.
- * @param array $visited The map of the already visited entities.
+ * @param object $entity The entity to delete.
+ * @param array $visited The map of the already visited entities.
+ *
+ * @return void
*
* @throws ORMInvalidArgumentException If the instance is a detached entity.
* @throws UnexpectedValueException
@@ -1676,11 +1714,11 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $entity
*
+ * @return object The managed copy of the entity.
+ *
* @throws OptimisticLockException If the entity uses optimistic locking through a version
* attribute and the version check against the managed copy fails.
*
- * @return object The managed copy of the entity.
- *
* @todo Require active transaction!? OptimisticLockException may result in undefined state!?
*/
public function merge($entity)
@@ -1693,17 +1731,17 @@ class UnitOfWork implements PropertyChangedListener
/**
* Executes a merge operation on an entity.
*
- * @param object $entity
- * @param array $visited
- * @param object $prevManagedCopy
- * @param array $assoc
+ * @param object $entity
+ * @param array $visited
+ * @param object|null $prevManagedCopy
+ * @param array|null $assoc
+ *
+ * @return object The managed copy of the entity.
*
* @throws OptimisticLockException If the entity uses optimistic locking through a version
* attribute and the version check against the managed copy fails.
* @throws ORMInvalidArgumentException If the entity instance is NEW.
* @throws EntityNotFoundException
- *
- * @return object The managed copy of the entity.
*/
private function doMerge($entity, array &$visited, $prevManagedCopy = null, $assoc = null)
{
@@ -1895,6 +1933,8 @@ class UnitOfWork implements PropertyChangedListener
* no longer be managed by Doctrine.
*
* @param object $entity The entity to detach.
+ *
+ * @return void
*/
public function detach($entity)
{
@@ -1906,9 +1946,11 @@ class UnitOfWork implements PropertyChangedListener
/**
* Executes a detach operation on the given entity.
*
- * @param object $entity
- * @param array $visited
- * @param boolean $noCascade if true, don't cascade detach operation
+ * @param object $entity
+ * @param array $visited
+ * @param boolean $noCascade if true, don't cascade detach operation.
+ *
+ * @return void
*/
private function doDetach($entity, array &$visited, $noCascade = false)
{
@@ -1951,6 +1993,8 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $entity The entity to refresh.
*
+ * @return void
+ *
* @throws InvalidArgumentException If the entity is not MANAGED.
*/
public function refresh($entity)
@@ -1963,8 +2007,10 @@ class UnitOfWork implements PropertyChangedListener
/**
* Executes a refresh operation on an entity.
*
- * @param object $entity The entity to refresh.
- * @param array $visited The already visited entities during cascades.
+ * @param object $entity The entity to refresh.
+ * @param array $visited The already visited entities during cascades.
+ *
+ * @return void
*
* @throws ORMInvalidArgumentException If the entity is not MANAGED.
*/
@@ -1996,7 +2042,9 @@ class UnitOfWork implements PropertyChangedListener
* Cascades a refresh operation to associated entities.
*
* @param object $entity
- * @param array $visited
+ * @param array $visited
+ *
+ * @return void
*/
private function cascadeRefresh($entity, array &$visited)
{
@@ -2037,7 +2085,9 @@ class UnitOfWork implements PropertyChangedListener
* Cascades a detach operation to associated entities.
*
* @param object $entity
- * @param array $visited
+ * @param array $visited
+ *
+ * @return void
*/
private function cascadeDetach($entity, array &$visited)
{
@@ -2079,7 +2129,9 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $entity
* @param object $managedCopy
- * @param array $visited
+ * @param array $visited
+ *
+ * @return void
*/
private function cascadeMerge($entity, $managedCopy, array &$visited)
{
@@ -2116,7 +2168,7 @@ class UnitOfWork implements PropertyChangedListener
* Cascades the save operation to associated entities.
*
* @param object $entity
- * @param array $visited
+ * @param array $visited
*
* @return void
*/
@@ -2159,7 +2211,9 @@ class UnitOfWork implements PropertyChangedListener
* Cascades the delete operation to associated entities.
*
* @param object $entity
- * @param array $visited
+ * @param array $visited
+ *
+ * @return void
*/
private function cascadeRemove($entity, array &$visited)
{
@@ -2200,14 +2254,14 @@ class UnitOfWork implements PropertyChangedListener
* Acquire a lock on the given entity.
*
* @param object $entity
- * @param int $lockMode
- * @param int $lockVersion
+ * @param int $lockMode
+ * @param int $lockVersion
+ *
+ * @return void
*
* @throws ORMInvalidArgumentException
* @throws TransactionRequiredException
* @throws OptimisticLockException
- *
- * @return void
*/
public function lock($entity, $lockMode, $lockVersion = null)
{
@@ -2271,7 +2325,9 @@ class UnitOfWork implements PropertyChangedListener
/**
* Clears the UnitOfWork.
*
- * @param string $entityName if given, only entities of this type will get detached
+ * @param string|null $entityName if given, only entities of this type will get detached.
+ *
+ * @return void
*/
public function clear($entityName = null)
{
@@ -2317,7 +2373,10 @@ class UnitOfWork implements PropertyChangedListener
* UnitOfWork.
*
* @ignore
+ *
* @param object $entity
+ *
+ * @return void
*/
public function scheduleOrphanRemoval($entity)
{
@@ -2329,6 +2388,8 @@ class UnitOfWork implements PropertyChangedListener
* Schedules a complete collection for removal when this UnitOfWork commits.
*
* @param PersistentCollection $coll
+ *
+ * @return void
*/
public function scheduleCollectionDeletion(PersistentCollection $coll)
{
@@ -2374,11 +2435,13 @@ class UnitOfWork implements PropertyChangedListener
* Creates an entity. Used for reconstitution of persistent entities.
*
* @ignore
+ *
* @param string $className The name of the entity class.
- * @param array $data The data for the entity.
- * @param array $hints Any hints to account for during reconstitution/lookup of the entity.
+ * @param array $data The data for the entity.
+ * @param array $hints Any hints to account for during reconstitution/lookup of the entity.
*
* @return object The managed entity instance.
+ *
* @internal Highly performance-sensitive method.
*
* @todo Rename: getOrCreateEntity
@@ -2657,6 +2720,7 @@ class UnitOfWork implements PropertyChangedListener
* @param \Doctrine\ORM\PersistentCollection $collection The collection to initialize.
*
* @return void
+ *
* @todo Maybe later move to EntityManager#initialize($proxyOrCollection). See DDC-733.
*/
public function loadCollection(PersistentCollection $collection)
@@ -2706,6 +2770,11 @@ class UnitOfWork implements PropertyChangedListener
/**
* @ignore
+ *
+ * @param object $entity
+ * @param array $data
+ *
+ * @return void
*/
public function setOriginalEntityData($entity, array $data)
{
@@ -2717,9 +2786,12 @@ class UnitOfWork implements PropertyChangedListener
* Sets a property value of the original data array of an entity.
*
* @ignore
+ *
* @param string $oid
* @param string $property
- * @param mixed $value
+ * @param mixed $value
+ *
+ * @return void
*/
public function setOriginalEntityProperty($oid, $property, $value)
{
@@ -2742,11 +2814,11 @@ class UnitOfWork implements PropertyChangedListener
}
/**
- * Process an entity instance to extract their identifier values.
+ * Processes an entity instance to extract their identifier values.
*
* @param object $entity The entity instance.
*
- * @return scalar
+ * @return mixed A scalar value.
*
* @throws \Doctrine\ORM\ORMInvalidArgumentException
*/
@@ -2769,11 +2841,11 @@ class UnitOfWork implements PropertyChangedListener
* Tries to find an entity with the given identifier in the identity map of
* this UnitOfWork.
*
- * @param mixed $id The entity identifier to look for.
+ * @param mixed $id The entity identifier to look for.
* @param string $rootClassName The name of the root class of the mapped entity hierarchy.
*
- * @return mixed Returns the entity with the specified identifier if it exists in
- * this UnitOfWork, FALSE otherwise.
+ * @return object|bool Returns the entity with the specified identifier if it exists in
+ * this UnitOfWork, FALSE otherwise.
*/
public function tryGetById($id, $rootClassName)
{
@@ -2790,6 +2862,9 @@ class UnitOfWork implements PropertyChangedListener
* Schedules an entity for dirty-checking at commit-time.
*
* @param object $entity The entity to schedule for dirty-checking.
+ *
+ * @return void
+ *
* @todo Rename: scheduleForSynchronization
*/
public function scheduleForDirtyCheck($entity)
@@ -2825,7 +2900,7 @@ class UnitOfWork implements PropertyChangedListener
/**
* Gets the EntityPersister for an Entity.
*
- * @param string $entityName The name of the Entity.
+ * @param string $entityName The name of the Entity.
*
* @return \Doctrine\ORM\Persisters\BasicEntityPersister
*/
@@ -2894,8 +2969,10 @@ class UnitOfWork implements PropertyChangedListener
* Registers an entity as managed.
*
* @param object $entity The entity.
- * @param array $id The identifier values.
- * @param array $data The original entity data.
+ * @param array $id The identifier values.
+ * @param array $data The original entity data.
+ *
+ * @return void
*/
public function registerManaged($entity, array $id, array $data)
{
@@ -2917,6 +2994,8 @@ class UnitOfWork implements PropertyChangedListener
* Clears the property changeset of the entity with the given OID.
*
* @param string $oid The entity's OID.
+ *
+ * @return void
*/
public function clearEntityChangeSet($oid)
{
@@ -2928,10 +3007,12 @@ class UnitOfWork implements PropertyChangedListener
/**
* Notifies this UnitOfWork of a property change in an entity.
*
- * @param object $entity The entity that owns the property.
+ * @param object $entity The entity that owns the property.
* @param string $propertyName The name of the property that changed.
- * @param mixed $oldValue The old value of the property.
- * @param mixed $newValue The new value of the property.
+ * @param mixed $oldValue The old value of the property.
+ * @param mixed $newValue The new value of the property.
+ *
+ * @return void
*/
public function propertyChanged($entity, $propertyName, $oldValue, $newValue)
{
@@ -2983,7 +3064,7 @@ class UnitOfWork implements PropertyChangedListener
}
/**
- * Get the currently scheduled complete collection deletions
+ * Gets the currently scheduled complete collection deletions
*
* @return array
*/
@@ -3005,7 +3086,7 @@ class UnitOfWork implements PropertyChangedListener
/**
* Helper method to initialize a lazy loading proxy or persistent collection.
*
- * @param object
+ * @param object $obj
*
* @return void
*/
@@ -3025,7 +3106,7 @@ class UnitOfWork implements PropertyChangedListener
/**
* Helper method to show an object as string.
*
- * @param object $obj
+ * @param object $obj
*
* @return string
*/
@@ -3040,12 +3121,11 @@ class UnitOfWork implements PropertyChangedListener
* This operation cannot be undone as some parts of the UnitOfWork now keep gathering information
* on this object that might be necessary to perform a correct update.
*
- *
* @param object $object
*
- * @throws ORMInvalidArgumentException
- *
* @return void
+ *
+ * @throws ORMInvalidArgumentException
*/
public function markReadOnly($object)
{
@@ -3061,9 +3141,9 @@ class UnitOfWork implements PropertyChangedListener
*
* @param object $object
*
- * @throws ORMInvalidArgumentException
- *
* @return bool
+ *
+ * @throws ORMInvalidArgumentException
*/
public function isReadOnly($object)
{
diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php
index c2bd13d6f..4dba7902f 100644
--- a/lib/Doctrine/ORM/Version.php
+++ b/lib/Doctrine/ORM/Version.php
@@ -42,6 +42,7 @@ class Version
* Compares a Doctrine version with the current one.
*
* @param string $version Doctrine version to compare.
+ *
* @return int Returns -1 if older, 0 if it is the same, 1 if version
* passed as argument is newer.
*/
diff --git a/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/tests/Doctrine/Tests/DbalFunctionalTestCase.php
index c4705a25e..0be58edf3 100644
--- a/tests/Doctrine/Tests/DbalFunctionalTestCase.php
+++ b/tests/Doctrine/Tests/DbalFunctionalTestCase.php
@@ -4,20 +4,30 @@ namespace Doctrine\Tests;
class DbalFunctionalTestCase extends DbalTestCase
{
- /* Shared connection when a TestCase is run alone (outside of it's functional suite) */
+ /**
+ * Shared connection when a TestCase is run alone (outside of its functional suite).
+ *
+ * @var \Doctrine\DBAL\Connection|null
+ */
private static $_sharedConn;
/**
- * @var Doctrine\DBAL\Connection
+ * @var \Doctrine\DBAL\Connection
*/
protected $_conn;
+ /**
+ * @return void
+ */
protected function resetSharedConn()
{
$this->sharedFixture['conn'] = null;
self::$_sharedConn = null;
}
+ /**
+ * @return void
+ */
protected function setUp()
{
if (isset($this->sharedFixture['conn'])) {
@@ -29,4 +39,4 @@ class DbalFunctionalTestCase extends DbalTestCase
$this->_conn = self::$_sharedConn;
}
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/DbalTestCase.php b/tests/Doctrine/Tests/DbalTestCase.php
index 2478e7bcc..35ef8bc86 100644
--- a/tests/Doctrine/Tests/DbalTestCase.php
+++ b/tests/Doctrine/Tests/DbalTestCase.php
@@ -7,4 +7,4 @@ namespace Doctrine\Tests;
*/
class DbalTestCase extends DoctrineTestCase
{
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php b/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php
index ae704f8bd..8395b6acd 100644
--- a/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php
+++ b/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php
@@ -7,26 +7,41 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
class NegativeToPositiveType extends Type
{
+ /**
+ * {@inheritdoc}
+ */
public function getName()
{
return 'negative_to_positive';
}
+ /**
+ * {@inheritdoc}
+ */
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration);
}
+ /**
+ * {@inheritdoc}
+ */
public function canRequireSQLConversion()
{
return true;
}
+ /**
+ * {@inheritdoc}
+ */
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
return 'ABS(' . $sqlExpr . ')';
}
+ /**
+ * {@inheritdoc}
+ */
public function convertToPHPValueSQL($sqlExpr, $platform)
{
return '-(' . $sqlExpr . ')';
diff --git a/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php b/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
index 47e8c790d..3811aa00d 100644
--- a/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
+++ b/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
@@ -7,21 +7,33 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
class UpperCaseStringType extends StringType
{
+ /**
+ * {@inheritdoc}
+ */
public function getName()
{
return 'upper_case_string';
}
+ /**
+ * {@inheritdoc}
+ */
public function canRequireSQLConversion()
{
return true;
}
+ /**
+ * {@inheritdoc}
+ */
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
return 'UPPER(' . $sqlExpr . ')';
}
+ /**
+ * {@inheritdoc}
+ */
public function convertToPHPValueSQL($sqlExpr, $platform)
{
return 'LOWER(' . $sqlExpr . ')';
diff --git a/tests/Doctrine/Tests/DoctrineTestCase.php b/tests/Doctrine/Tests/DoctrineTestCase.php
index e8323d294..e5ce27af9 100644
--- a/tests/Doctrine/Tests/DoctrineTestCase.php
+++ b/tests/Doctrine/Tests/DoctrineTestCase.php
@@ -7,4 +7,4 @@ namespace Doctrine\Tests;
*/
abstract class DoctrineTestCase extends \PHPUnit_Framework_TestCase
{
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php b/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
index c6be1b79c..deab5239a 100644
--- a/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
+++ b/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
@@ -2,13 +2,18 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for ClassMetadata.
+ */
class ClassMetadataMock extends \Doctrine\ORM\Mapping\ClassMetadata
{
/* Mock API */
+ /**
+ * {@inheritdoc}
+ */
public function setIdGeneratorType($type)
{
$this->_generatorType = $type;
}
-
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/tests/Doctrine/Tests/Mocks/ConnectionMock.php
index 90ebfec30..9e681967b 100644
--- a/tests/Doctrine/Tests/Mocks/ConnectionMock.php
+++ b/tests/Doctrine/Tests/Mocks/ConnectionMock.php
@@ -2,14 +2,42 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for Connection.
+ */
class ConnectionMock extends \Doctrine\DBAL\Connection
{
+ /**
+ * @var mixed
+ */
private $_fetchOneResult;
+
+ /**
+ * @var DatabasePlatformMock
+ */
private $_platformMock;
+
+ /**
+ * @var int
+ */
private $_lastInsertId = 0;
+
+ /**
+ * @var array
+ */
private $_inserts = array();
+
+ /**
+ * @var array
+ */
private $_executeUpdates = array();
+ /**
+ * @param array $params
+ * @param \Doctrine\DBAL\Driver $driver
+ * @param \Doctrine\DBAL\Configuration|null $config
+ * @param \Doctrine\Common\EventManager|null $eventManager
+ */
public function __construct(array $params, $driver, $config = null, $eventManager = null)
{
$this->_platformMock = new DatabasePlatformMock();
@@ -21,7 +49,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function getDatabasePlatform()
{
@@ -29,7 +57,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function insert($tableName, array $data, array $types = array())
{
@@ -37,7 +65,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function executeUpdate($query, array $params = array(), array $types = array())
{
@@ -45,7 +73,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function lastInsertId($seqName = null)
{
@@ -53,7 +81,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function fetchColumn($statement, array $params = array(), $colnum = 0)
{
@@ -61,7 +89,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
}
/**
- * @override
+ * {@inheritdoc}
*/
public function quote($input, $type = null)
{
@@ -73,34 +101,58 @@ class ConnectionMock extends \Doctrine\DBAL\Connection
/* Mock API */
+ /**
+ * @param mixed $fetchOneResult
+ *
+ * @return void
+ */
public function setFetchOneResult($fetchOneResult)
{
$this->_fetchOneResult = $fetchOneResult;
}
+ /**
+ * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
+ * @return void
+ */
public function setDatabasePlatform($platform)
{
$this->_platformMock = $platform;
}
+ /**
+ * @param int $id
+ *
+ * @return void
+ */
public function setLastInsertId($id)
{
$this->_lastInsertId = $id;
}
+ /**
+ * @return array
+ */
public function getInserts()
{
return $this->_inserts;
}
+ /**
+ * @return array
+ */
public function getExecuteUpdates()
{
return $this->_executeUpdates;
}
+ /**
+ * @return void
+ */
public function reset()
{
$this->_inserts = array();
$this->_lastInsertId = 0;
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
index b634408be..9ffaaa692 100644
--- a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
+++ b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
@@ -2,24 +2,42 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for DatabasePlatform.
+ */
class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
{
+ /**
+ * @var string
+ */
private $_sequenceNextValSql = "";
+
+ /**
+ * @var bool
+ */
private $_prefersIdentityColumns = true;
+
+ /**
+ * @var bool
+ */
private $_prefersSequences = false;
/**
- * @override
+ * {@inheritdoc}
*/
- public function getNativeDeclaration(array $field) {}
+ public function getNativeDeclaration(array $field)
+ {
+ }
/**
- * @override
+ * {@inheritdoc}
*/
- public function getPortableDeclaration(array $field) {}
+ public function getPortableDeclaration(array $field)
+ {
+ }
/**
- * @override
+ * {@inheritdoc}
*/
public function prefersIdentityColumns()
{
@@ -27,71 +45,122 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
}
/**
- * @override
+ * {@inheritdoc}
*/
public function prefersSequences()
{
return $this->_prefersSequences;
}
- /** @override */
+ /**
+ * {@inheritdoc}
+ */
public function getSequenceNextValSQL($sequenceName)
{
return $this->_sequenceNextValSql;
}
- /** @override */
- public function getBooleanTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getBooleanTypeDeclarationSQL(array $field)
+ {
+ }
- /** @override */
- public function getIntegerTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getIntegerTypeDeclarationSQL(array $field)
+ {
+ }
- /** @override */
- public function getBigIntTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getBigIntTypeDeclarationSQL(array $field)
+ {
+ }
- /** @override */
- public function getSmallIntTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getSmallIntTypeDeclarationSQL(array $field)
+ {
+ }
- /** @override */
- protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
+ /**
+ * {@inheritdoc}
+ */
+ protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef)
+ {
+ }
- /** @override */
- public function getVarcharTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getVarcharTypeDeclarationSQL(array $field)
+ {
+ }
- /** @override */
- public function getClobTypeDeclarationSQL(array $field) {}
+ /**
+ * {@inheritdoc}
+ */
+ public function getClobTypeDeclarationSQL(array $field)
+ {
+ }
/* MOCK API */
+ /**
+ * @param bool $bool
+ *
+ * @return void
+ */
public function setPrefersIdentityColumns($bool)
{
$this->_prefersIdentityColumns = $bool;
}
+ /**
+ * @param bool $bool
+ *
+ * @return void
+ */
public function setPrefersSequences($bool)
{
$this->_prefersSequences = $bool;
}
+ /**
+ * @param string $sql
+ *
+ * @return void
+ */
public function setSequenceNextValSql($sql)
{
$this->_sequenceNextValSql = $sql;
}
+ /**
+ * {@inheritdoc}
+ */
public function getName()
{
return 'mock';
}
+ /**
+ * {@inheritdoc}
+ */
protected function initializeDoctrineTypeMappings()
{
-
}
+
/**
- * Gets the SQL Snippet used to declare a BLOB column type.
+ * {@inheritdoc}
*/
public function getBlobTypeDeclarationSQL(array $field)
{
throw DBALException::notSupported(__METHOD__);
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
index a18e24a4d..631fa0356 100644
--- a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
+++ b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
@@ -2,16 +2,79 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for DriverConnection.
+ */
class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection
{
- public function prepare($prepareString) {}
- public function query() { return new StatementMock; }
- public function quote($input, $type=\PDO::PARAM_STR) {}
- public function exec($statement) {}
- public function lastInsertId($name = null) {}
- public function beginTransaction() {}
- public function commit() {}
- public function rollBack() {}
- public function errorCode() {}
- public function errorInfo() {}
+ /**
+ * {@inheritdoc}
+ */
+ public function prepare($prepareString)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function query()
+ {
+ return new StatementMock;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function quote($input, $type=\PDO::PARAM_STR)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function exec($statement)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function lastInsertId($name = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function beginTransaction()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function commit()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rollBack()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function errorCode()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function errorInfo()
+ {
+ }
}
diff --git a/tests/Doctrine/Tests/Mocks/DriverMock.php b/tests/Doctrine/Tests/Mocks/DriverMock.php
index c60a137f5..c7a101094 100644
--- a/tests/Doctrine/Tests/Mocks/DriverMock.php
+++ b/tests/Doctrine/Tests/Mocks/DriverMock.php
@@ -2,13 +2,24 @@
namespace Doctrine\Tests\Mocks;
-
+/**
+ * Mock class for Driver.
+ */
class DriverMock implements \Doctrine\DBAL\Driver
{
+ /**
+ * @var \Doctrine\DBAL\Platforms\AbstractPlatform|null
+ */
private $_platformMock;
+ /**
+ * @var \Doctrine\DBAL\Schema\AbstractSchemaManager|null
+ */
private $_schemaManagerMock;
+ /**
+ * {@inheritdoc}
+ */
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
return new DriverConnectionMock();
@@ -17,7 +28,10 @@ class DriverMock implements \Doctrine\DBAL\Driver
/**
* Constructs the Sqlite PDO DSN.
*
- * @return string The DSN.
+ * @param array $params
+ *
+ * @return string The DSN.
+ *
* @override
*/
protected function _constructPdoDsn(array $params)
@@ -26,7 +40,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
}
/**
- * @override
+ * {@inheritdoc}
*/
public function getDatabasePlatform()
{
@@ -37,11 +51,11 @@ class DriverMock implements \Doctrine\DBAL\Driver
}
/**
- * @override
+ * {@inheritdoc}
*/
public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{
- if($this->_schemaManagerMock == null) {
+ if ($this->_schemaManagerMock == null) {
return new SchemaManagerMock($conn);
} else {
return $this->_schemaManagerMock;
@@ -50,23 +64,39 @@ class DriverMock implements \Doctrine\DBAL\Driver
/* MOCK API */
+ /**
+ * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ *
+ * @return void
+ */
public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform)
{
$this->_platformMock = $platform;
}
+ /**
+ * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $sm
+ *
+ * @return void
+ */
public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm)
{
$this->_schemaManagerMock = $sm;
}
+ /**
+ * {@inheritdoc}
+ */
public function getName()
{
return 'mock';
}
+ /**
+ * {@inheritdoc}
+ */
public function getDatabase(\Doctrine\DBAL\Connection $conn)
{
return;
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/EntityManagerMock.php b/tests/Doctrine/Tests/Mocks/EntityManagerMock.php
index ca49410ad..91f1c9daa 100644
--- a/tests/Doctrine/Tests/Mocks/EntityManagerMock.php
+++ b/tests/Doctrine/Tests/Mocks/EntityManagerMock.php
@@ -28,12 +28,23 @@ use Doctrine\ORM\Proxy\ProxyFactory;
*/
class EntityManagerMock extends \Doctrine\ORM\EntityManager
{
+ /**
+ * @var \Doctrine\ORM\UnitOfWork|null
+ */
private $_uowMock;
+
+ /**
+ * @var \Doctrine\ORM\Proxy\ProxyFactory|null
+ */
private $_proxyFactoryMock;
+
+ /**
+ * @var array
+ */
private $_idGenerators = array();
/**
- * @override
+ * {@inheritdoc}
*/
public function getUnitOfWork()
{
@@ -45,18 +56,28 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
/**
* Sets a (mock) UnitOfWork that will be returned when getUnitOfWork() is called.
*
- * @param $uow
+ * @param \Doctrine\ORM\UnitOfWork $uow
+ *
+ * @return void
*/
public function setUnitOfWork($uow)
{
$this->_uowMock = $uow;
}
+ /**
+ * @param \Doctrine\ORM\Proxy\ProxyFactory $proxyFactory
+ *
+ * @return void
+ */
public function setProxyFactory($proxyFactory)
{
$this->_proxyFactoryMock = $proxyFactory;
}
+ /**
+ * @return \Doctrine\ORM\Proxy\ProxyFactory
+ */
public function getProxyFactory()
{
return isset($this->_proxyFactoryMock) ? $this->_proxyFactoryMock : parent::getProxyFactory();
@@ -65,11 +86,7 @@ class EntityManagerMock extends \Doctrine\ORM\EntityManager
/**
* Mock factory method to create an EntityManager.
*
- * @param unknown_type $conn
- * @param unknown_type $name
- * @param Doctrine_Configuration $config
- * @param Doctrine_EventManager $eventManager
- * @return Doctrine\ORM\EntityManager
+ * {@inheritdoc}
*/
public static function create($conn, \Doctrine\ORM\Configuration $config = null,
\Doctrine\Common\EventManager $eventManager = null)
diff --git a/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php b/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
index 4c071c751..862000eb5 100644
--- a/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
+++ b/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
@@ -7,17 +7,46 @@ namespace Doctrine\Tests\Mocks;
*/
class EntityPersisterMock extends \Doctrine\ORM\Persisters\BasicEntityPersister
{
+ /**
+ * @var array
+ */
private $inserts = array();
+
+ /**
+ * @var array
+ */
private $updates = array();
+
+ /**
+ * @var array
+ */
private $deletes = array();
+
+ /**
+ * @var int
+ */
private $identityColumnValueCounter = 0;
+
+ /**
+ * @var int|null
+ */
private $mockIdGeneratorType;
+
+ /**
+ * @var array
+ */
private $postInsertIds = array();
+
+ /**
+ * @var bool
+ */
private $existsCalled = false;
/**
- * @param $entity
- * @return
+ * @param object $entity
+ *
+ * @return mixed
+ *
* @override
*/
public function insert($entity)
@@ -32,6 +61,11 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\BasicEntityPersister
return null;
}
+ /**
+ * @param object $entity
+ *
+ * @return mixed
+ */
public function addInsert($entity)
{
$this->inserts[] = $entity;
@@ -44,46 +78,75 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\BasicEntityPersister
return null;
}
+ /**
+ * @return array
+ */
public function executeInserts()
{
return $this->postInsertIds;
}
+ /**
+ * @param int $genType
+ *
+ * @return void
+ */
public function setMockIdGeneratorType($genType)
{
$this->mockIdGeneratorType = $genType;
}
+ /**
+ * {@inheritdoc}
+ */
public function update($entity)
{
$this->updates[] = $entity;
}
+ /**
+ * {@inheritdoc}
+ */
public function exists($entity, array $extraConditions = array())
{
$this->existsCalled = true;
}
+ /**
+ * {@inheritdoc}
+ */
public function delete($entity)
{
$this->deletes[] = $entity;
}
+ /**
+ * @return array
+ */
public function getInserts()
{
return $this->inserts;
}
+ /**
+ * @return array
+ */
public function getUpdates()
{
return $this->updates;
}
+ /**
+ * @return array
+ */
public function getDeletes()
{
return $this->deletes;
}
+ /**
+ * @return void
+ */
public function reset()
{
$this->existsCalled = false;
@@ -93,8 +156,11 @@ class EntityPersisterMock extends \Doctrine\ORM\Persisters\BasicEntityPersister
$this->deletes = array();
}
+ /**
+ * @return bool
+ */
public function isExistsCalled()
{
return $this->existsCalled;
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
index 297d41ee3..6c9ff6b8b 100644
--- a/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
+++ b/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
@@ -10,12 +10,15 @@ namespace Doctrine\Tests\Mocks;
*/
class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
{
+ /**
+ * @var array
+ */
private $_resultSet;
/**
* Creates a new mock statement that will serve the provided fake result set to clients.
*
- * @param array $resultSet The faked SQL result set.
+ * @param array $resultSet The faked SQL result set.
*/
public function __construct(array $resultSet)
{
@@ -25,6 +28,10 @@ class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver
/**
* Fetches all rows from the result set.
*
+ * @param int|null $fetchStyle
+ * @param int|null $columnIndex
+ * @param array|null $ctorArgs
+ *
* @return array
*/
public function fetchAll($fetchStyle = null, $columnIndex = null, array $ctorArgs = null)
@@ -32,6 +39,9 @@ class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver
return $this->_resultSet;
}
+ /**
+ * {@inheritdoc}
+ */
public function fetchColumn($columnNumber = 0)
{
$row = current($this->_resultSet);
@@ -41,8 +51,7 @@ class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver
}
/**
- * Fetches the next row in the result set.
- *
+ * {@inheritdoc}
*/
public function fetch($fetchStyle = null)
{
@@ -52,15 +61,18 @@ class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver
}
/**
- * Closes the cursor, enabling the statement to be executed again.
- *
- * @return boolean
+ * {@inheritdoc}
*/
public function closeCursor()
{
return true;
}
+ /**
+ * @param array $resultSet
+ *
+ * @return void
+ */
public function setResultSet(array $resultSet)
{
reset($resultSet);
@@ -71,41 +83,67 @@ class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver
{
}
+ /**
+ * {@inheritdoc}
+ */
public function bindValue($param, $value, $type = null)
{
}
+ /**
+ * {@inheritdoc}
+ */
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
{
}
+ /**
+ * {@inheritdoc}
+ */
public function columnCount()
{
}
+ /**
+ * {@inheritdoc}
+ */
public function errorCode()
{
}
+ /**
+ * {@inheritdoc}
+ */
public function errorInfo()
{
}
+ /**
+ * {@inheritdoc}
+ */
public function execute($params = array())
{
}
+ /**
+ * {@inheritdoc}
+ */
public function rowCount()
{
}
+ /**
+ * {@inheritdoc}
+ */
public function getIterator()
{
return $this->_resultSet;
}
+ /**
+ * {@inheritdoc}
+ */
public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
{
-
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php b/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
index 0c5696b48..868b7fe44 100644
--- a/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
+++ b/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
@@ -2,11 +2,15 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for IdentityGenerator.
+ */
class IdentityIdGeneratorMock extends \Doctrine\ORM\Id\IdentityGenerator
{
private $_mockPostInsertId;
- public function setMockPostInsertId($id) {
+ public function setMockPostInsertId($id)
+ {
$this->_mockPostInsertId = $id;
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
index 3dfb5e3a9..21339c5f9 100644
--- a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
+++ b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
@@ -2,20 +2,31 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for MappingDriver.
+ */
class MetadataDriverMock implements \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver
{
+ /**
+ * {@inheritdoc}
+ */
public function loadMetadataForClass($className, \Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata)
{
- return;
}
+ /**
+ * {@inheritdoc}
+ */
public function isTransient($className)
{
return false;
}
+ /**
+ * {@inheritdoc}
+ */
public function getAllClassNames()
{
return array();
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/Mocks/MockTreeWalker.php b/tests/Doctrine/Tests/Mocks/MockTreeWalker.php
index b92b99f43..fd6c81815 100644
--- a/tests/Doctrine/Tests/Mocks/MockTreeWalker.php
+++ b/tests/Doctrine/Tests/Mocks/MockTreeWalker.php
@@ -2,16 +2,16 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for TreeWalker.
+ */
class MockTreeWalker extends \Doctrine\ORM\Query\TreeWalkerAdapter
{
/**
- * Gets an executor that can be used to execute the result of this walker.
- *
- * @return AbstractExecutor
+ * {@inheritdoc}
*/
public function getExecutor($AST)
{
return null;
}
}
-
diff --git a/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php b/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
index d4c3c28c0..02c7c0a79 100644
--- a/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
+++ b/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
@@ -2,12 +2,23 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for AbstractSchemaManager.
+ */
class SchemaManagerMock extends \Doctrine\DBAL\Schema\AbstractSchemaManager
{
+ /**
+ * @param \Doctrine\DBAL\Connection $conn
+ */
public function __construct(\Doctrine\DBAL\Connection $conn)
{
parent::__construct($conn);
}
- protected function _getPortableTableColumnDefinition($tableColumn) {}
-}
\ No newline at end of file
+ /**
+ * {@inheritdoc}
+ */
+ protected function _getPortableTableColumnDefinition($tableColumn)
+ {
+ }
+}
diff --git a/tests/Doctrine/Tests/Mocks/SequenceMock.php b/tests/Doctrine/Tests/Mocks/SequenceMock.php
index 73a23d8c9..8612e0d27 100644
--- a/tests/Doctrine/Tests/Mocks/SequenceMock.php
+++ b/tests/Doctrine/Tests/Mocks/SequenceMock.php
@@ -4,10 +4,19 @@ namespace Doctrine\Tests\Mocks;
use Doctrine\ORM\EntityManager;
+/**
+ * Mock class for SequenceGenerator.
+ */
class SequenceMock extends \Doctrine\ORM\Id\SequenceGenerator
{
+ /**
+ * @var int
+ */
private $_sequenceNumber = 0;
+ /**
+ * {@inheritdoc}
+ */
public function generate(EntityManager $em, $entity)
{
return $this->_sequenceNumber++;
@@ -39,14 +48,19 @@ class SequenceMock extends \Doctrine\ORM\Id\SequenceGenerator
/* Mock API */
+ /**
+ * @return void
+ */
public function reset()
{
$this->_sequenceNumber = 0;
}
+ /**
+ * @return void
+ */
public function autoinc()
{
$this->_sequenceNumber++;
}
}
-
diff --git a/tests/Doctrine/Tests/Mocks/StatementMock.php b/tests/Doctrine/Tests/Mocks/StatementMock.php
index 9b6959ff4..40ad1f3e5 100644
--- a/tests/Doctrine/Tests/Mocks/StatementMock.php
+++ b/tests/Doctrine/Tests/Mocks/StatementMock.php
@@ -9,17 +9,92 @@ namespace Doctrine\Tests\Mocks;
*/
class StatementMock implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
{
- public function bindValue($param, $value, $type = null){}
- public function bindParam($column, &$variable, $type = null, $length = null){}
- public function errorCode(){}
+ /**
+ * {@inheritdoc}
+ */
+ public function bindValue($param, $value, $type = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function bindParam($column, &$variable, $type = null, $length = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function errorCode()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function errorInfo(){}
- public function execute($params = null){}
- public function rowCount(){}
- public function closeCursor(){}
- public function columnCount(){}
- public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null){}
- public function fetch($fetchStyle = null){}
- public function fetchAll($fetchStyle = null){}
- public function fetchColumn($columnIndex = 0){}
- public function getIterator(){}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function execute($params = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rowCount()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function closeCursor()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function columnCount()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function fetch($fetchStyle = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function fetchAll($fetchStyle = null)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function fetchColumn($columnIndex = 0)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIterator()
+ {
+ }
}
diff --git a/tests/Doctrine/Tests/Mocks/TaskMock.php b/tests/Doctrine/Tests/Mocks/TaskMock.php
index d4d50689d..22676f67a 100644
--- a/tests/Doctrine/Tests/Mocks/TaskMock.php
+++ b/tests/Doctrine/Tests/Mocks/TaskMock.php
@@ -25,6 +25,7 @@ use Doctrine\Common\Cli\AbstractNamespace;
/**
* TaskMock used for testing the CLI interface.
+ *
* @author Nils Adermann
*/
class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask
@@ -33,17 +34,20 @@ class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask
* Since instances of this class can be created elsewhere all instances
* register themselves in this array for later inspection.
*
- * @var array(TaskMock)
+ * @var array (TaskMock)
*/
static public $instances = array();
+ /**
+ * @var int
+ */
private $runCounter = 0;
/**
* Constructor of Task Mock Object.
* Makes sure the object can be inspected later.
*
- * @param AbstractNamespace CLI Namespace, passed to parent constructor
+ * @param AbstractNamespace $namespace CLI Namespace, passed to parent constructor.
*/
function __construct(AbstractNamespace $namespace)
{
@@ -66,6 +70,8 @@ class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask
/**
* Method invoked by CLI to run task.
+ *
+ * @return void
*/
public function run()
{
@@ -73,7 +79,9 @@ class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask
}
/**
- * Method supposed to generate the CLI Task Documentation
+ * Method supposed to generate the CLI Task Documentation.
+ *
+ * @return void
*/
public function buildDocumentation()
{
diff --git a/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php b/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
index 9535cdde3..95c511c70 100644
--- a/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
+++ b/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
@@ -2,13 +2,23 @@
namespace Doctrine\Tests\Mocks;
+/**
+ * Mock class for UnitOfWork.
+ */
class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork
{
+ /**
+ * @var array
+ */
private $_mockDataChangeSets = array();
+
+ /**
+ * @var array|null
+ */
private $_persisterMock;
/**
- * @override
+ * {@inheritdoc}
*/
public function getEntityPersister($entityName)
{
@@ -17,8 +27,7 @@ class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork
}
/**
- * @param $entity
- * @override
+ * {@inheritdoc}
*/
public function getEntityChangeSet($entity)
{
@@ -33,26 +42,43 @@ class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork
* Sets a (mock) persister for an entity class that will be returned when
* getEntityPersister() is invoked for that class.
*
- * @param $entityName
- * @param $persister
+ * @param string $entityName
+ * @param \Doctrine\ORM\Persisters\BasicEntityPersister $persister
+ *
+ * @return void
*/
public function setEntityPersister($entityName, $persister)
{
$this->_persisterMock[$entityName] = $persister;
}
+ /**
+ * @param object $entity
+ * @param array $mockChangeSet
+ *
+ * @return void
+ */
public function setDataChangeSet($entity, array $mockChangeSet)
{
$this->_mockDataChangeSets[spl_object_hash($entity)] = $mockChangeSet;
}
+ /**
+ * @param object $entity
+ * @param mixed $state
+ *
+ * @return void
+ */
public function setEntityState($entity, $state)
{
$this->_entityStates[spl_object_hash($entity)] = $state;
}
+ /**
+ * {@inheritdoc}
+ */
public function setOriginalEntityData($entity, array $originalData)
{
$this->_originalEntityData[spl_object_hash($entity)] = $originalData;
}
-}
\ No newline at end of file
+}
diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php
index f8b41e06a..f75849956 100644
--- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php
+++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php
@@ -223,7 +223,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId);
$this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized.");
- // Test One to Many existance retrieved from DB
+ // Test One to Many existence retrieved from DB
$article = $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId);
$queryCount = $this->getCurrentQueryCount();
@@ -231,7 +231,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized.");
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount());
- // Test One to Many existance with state new
+ // Test One to Many existence with state new
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
$article->topic = "Testnew";
$article->text = "blub";
@@ -240,7 +240,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertFalse($user->articles->contains($article));
$this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed.");
- // Test One to Many existance with state clear
+ // Test One to Many existence with state clear
$this->_em->persist($article);
$this->_em->flush();
@@ -249,7 +249,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed.");
$this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized.");
- // Test One to Many existance with state managed
+ // Test One to Many existence with state managed
$article = new \Doctrine\Tests\Models\CMS\CmsArticle();
$article->topic = "How to not fail anymore on tests";
$article->text = "That is simple! Just write more tests!";
@@ -271,7 +271,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId);
$this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized.");
- // Test Many to Many existance retrieved from DB
+ // Test Many to Many existence retrieved from DB
$group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId);
$queryCount = $this->getCurrentQueryCount();
@@ -279,7 +279,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed.");
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
- // Test Many to Many existance with state new
+ // Test Many to Many existence with state new
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
$group->name = "A New group!";
@@ -289,7 +289,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed.");
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
- // Test Many to Many existance with state clear
+ // Test Many to Many existence with state clear
$this->_em->persist($group);
$this->_em->flush();
@@ -299,7 +299,7 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed.");
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");
- // Test Many to Many existance with state managed
+ // Test Many to Many existence with state managed
$group = new \Doctrine\Tests\Models\CMS\CmsGroup();
$group->name = "My managed group";
diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php
index 4b72a9a27..715c32a5f 100644
--- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php
+++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php
@@ -9,12 +9,25 @@ namespace Doctrine\Tests;
*/
abstract class OrmFunctionalTestCase extends OrmTestCase
{
- /* The metadata cache shared between all functional tests. */
+ /**
+ * The metadata cache shared between all functional tests.
+ *
+ * @var \Doctrine\Common\Cache\Cache|null
+ */
private static $_metadataCacheImpl = null;
- /* The query cache shared between all functional tests. */
+
+ /**
+ * The query cache shared between all functional tests.
+ *
+ * @var \Doctrine\Common\Cache\Cache|null
+ */
private static $_queryCacheImpl = null;
- /* Shared connection when a TestCase is run alone (outside of it's functional suite) */
+ /**
+ * Shared connection when a TestCase is run alone (outside of its functional suite).
+ *
+ * @var \Doctrine\DBAL\Connection|null
+ */
protected static $_sharedConn;
/**
@@ -32,19 +45,32 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
*/
protected $_sqlLoggerStack;
- /** The names of the model sets used in this testcase. */
+ /**
+ * The names of the model sets used in this testcase.
+ *
+ * @var array
+ */
protected $_usedModelSets = array();
- /** Whether the database schema has already been created. */
+ /**
+ * Whether the database schema has already been created.
+ *
+ * @var array
+ */
protected static $_tablesCreated = array();
/**
* Array of entity class name to their tables that were created.
+ *
* @var array
*/
protected static $_entityTablesCreated = array();
- /** List of model sets and their classes. */
+ /**
+ * List of model sets and their classes.
+ *
+ * @var array
+ */
protected static $_modelSets = array(
'cms' => array(
'Doctrine\Tests\Models\CMS\CmsUser',
@@ -126,6 +152,11 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
),
);
+ /**
+ * @param string $setName
+ *
+ * @return void
+ */
protected function useModelSet($setName)
{
$this->_usedModelSets[$setName] = true;
@@ -133,6 +164,8 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
/**
* Sweeps the database tables and clears the EntityManager.
+ *
+ * @return void
*/
protected function tearDown()
{
@@ -242,6 +275,13 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
$this->_em->clear();
}
+ /**
+ * @param array $classNames
+ *
+ * @return void
+ *
+ * @throws \RuntimeException
+ */
protected function setUpEntitySchema(array $classNames)
{
if ($this->_em === null) {
@@ -264,6 +304,8 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
/**
* Creates a connection to the test database, if there is none yet, and
* creates the necessary tables.
+ *
+ * @return void
*/
protected function setUp()
{
@@ -312,9 +354,10 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
/**
* Gets an EntityManager for testing purposes.
*
- * @param Configuration $config The Configuration to pass to the EntityManager.
- * @param EventManager $eventManager The EventManager to pass to the EntityManager.
- * @return EntityManager
+ * @param \Doctrine\ORM\Configuration $config The Configuration to pass to the EntityManager.
+ * @param \Doctrine\Common\EventManager $eventManager The EventManager to pass to the EntityManager.
+ *
+ * @return \Doctrine\ORM\EntityManager
*/
protected function _getEntityManager($config = null, $eventManager = null) {
// NOTE: Functional tests use their own shared metadata cache, because
@@ -370,6 +413,13 @@ abstract class OrmFunctionalTestCase extends OrmTestCase
return \Doctrine\ORM\EntityManager::create($conn, $config);
}
+ /**
+ * @param \Exception $e
+ *
+ * @return void
+ *
+ * @throws \Exception
+ */
protected function onNotSuccessfulTest(\Exception $e)
{
if ($e instanceof \PHPUnit_Framework_AssertionFailedError) {
diff --git a/tests/Doctrine/Tests/OrmPerformanceTestCase.php b/tests/Doctrine/Tests/OrmPerformanceTestCase.php
index ab8fcf503..39bae39b6 100644
--- a/tests/Doctrine/Tests/OrmPerformanceTestCase.php
+++ b/tests/Doctrine/Tests/OrmPerformanceTestCase.php
@@ -3,18 +3,19 @@
namespace Doctrine\Tests;
/**
- * Description of DoctrinePerformanceTestCase
+ * Description of DoctrinePerformanceTestCase.
*
* @author robo
*/
class OrmPerformanceTestCase extends OrmFunctionalTestCase
{
/**
- * @var integer
+ * @var integer
*/
protected $maxRunningTime = 0;
/**
+ * @return void
*/
protected function runTest()
{
@@ -35,9 +36,13 @@ class OrmPerformanceTestCase extends OrmFunctionalTestCase
}
/**
- * @param integer $maxRunningTime
- * @throws InvalidArgumentException
- * @since Method available since Release 2.3.0
+ * @param integer $maxRunningTime
+ *
+ * @return void
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @since Method available since Release 2.3.0
*/
public function setMaxRunningTime($maxRunningTime)
{
@@ -50,11 +55,11 @@ class OrmPerformanceTestCase extends OrmFunctionalTestCase
/**
* @return integer
- * @since Method available since Release 2.3.0
+ *
+ * @since Method available since Release 2.3.0
*/
public function getMaxRunningTime()
{
return $this->maxRunningTime;
}
}
-
diff --git a/tests/Doctrine/Tests/OrmTestCase.php b/tests/Doctrine/Tests/OrmTestCase.php
index 4ad60d68b..9ba32cf8b 100644
--- a/tests/Doctrine/Tests/OrmTestCase.php
+++ b/tests/Doctrine/Tests/OrmTestCase.php
@@ -9,14 +9,24 @@ use Doctrine\Common\Cache\ArrayCache;
*/
abstract class OrmTestCase extends DoctrineTestCase
{
- /** The metadata cache that is shared between all ORM tests (except functional tests). */
+ /**
+ * The metadata cache that is shared between all ORM tests (except functional tests).
+ *
+ * @var \Doctrine\Common\Cache\Cache|null
+ */
private static $_metadataCacheImpl = null;
- /** The query cache that is shared between all ORM tests (except functional tests). */
+ /**
+ * The query cache that is shared between all ORM tests (except functional tests).
+ *
+ * @var \Doctrine\Common\Cache\Cache|null
+ */
private static $_queryCacheImpl = null;
/**
* @param array $paths
+ * @param mixed $alias
+ *
* @return \Doctrine\ORM\Mapping\Driver\AnnotationDriver
*/
protected function createAnnotationDriver($paths = array(), $alias = null)
@@ -65,7 +75,12 @@ abstract class OrmTestCase extends DoctrineTestCase
* be configured in the tests to simulate the DBAL behavior that is desired
* for a particular test,
*
- * @return Doctrine\ORM\EntityManager
+ * @param \Doctrine\DBAL\Connection|array $conn
+ * @param mixed $conf
+ * @param \Doctrine\Common\EventManager|null $eventManager
+ * @param bool $withSharedMetadata
+ *
+ * @return \Doctrine\ORM\EntityManager
*/
protected function _getTestEntityManager($conn = null, $conf = null, $eventManager = null, $withSharedMetadata = true)
{
@@ -97,6 +112,9 @@ abstract class OrmTestCase extends DoctrineTestCase
return \Doctrine\Tests\Mocks\EntityManagerMock::create($conn, $config, $eventManager);
}
+ /**
+ * @return \Doctrine\Common\Cache\Cache
+ */
private static function getSharedMetadataCacheImpl()
{
if (self::$_metadataCacheImpl === null) {
@@ -106,6 +124,9 @@ abstract class OrmTestCase extends DoctrineTestCase
return self::$_metadataCacheImpl;
}
+ /**
+ * @return \Doctrine\Common\Cache\Cache
+ */
private static function getSharedQueryCacheImpl()
{
if (self::$_queryCacheImpl === null) {
diff --git a/tests/Doctrine/Tests/TestUtil.php b/tests/Doctrine/Tests/TestUtil.php
index b78d06e4e..451a2b76d 100644
--- a/tests/Doctrine/Tests/TestUtil.php
+++ b/tests/Doctrine/Tests/TestUtil.php
@@ -28,7 +28,7 @@ class TestUtil
* 1) Each invocation of this method returns a NEW database connection.
* 2) The database is dropped and recreated to ensure it's clean.
*
- * @return Doctrine\DBAL\Connection The database connection instance.
+ * @return \Doctrine\DBAL\Connection The database connection instance.
*/
public static function getConnection()
{
@@ -116,4 +116,4 @@ class TestUtil
// Connect to tmpdb in order to drop and create the real test db.
return \Doctrine\DBAL\DriverManager::getConnection($tmpDbParams);
}
-}
\ No newline at end of file
+}