Commit 455f8774 authored by romanb's avatar romanb

[2.0] Minor refactorings and docblock adjustments. Fixed #3202.

parent 6729ed28
......@@ -24,7 +24,7 @@ namespace Doctrine\ORM\Mapping\Driver;
use Doctrine\ORM\Mapping\MappingException;
/**
* SchemaMetadata mapping driver interface
* Base driver for file-based metadata drivers.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
......
......@@ -99,23 +99,23 @@ class AnnotationDriver implements Driver
$mapping = array();
$mapping['fieldName'] = $property->getName();
// Check for DoctrineJoinColummn/DoctrineJoinColumns annotations
// Check for JoinColummn/JoinColumns annotations
$joinColumns = array();
if ($joinColumnAnnot = $property->getAnnotation('JoinColumn')) {
$joinColumns[] = array(
'name' => $joinColumnAnnot->name,
'referencedColumnName' => $joinColumnAnnot->referencedColumnName,
'unique' => $joinColumnAnnot->unique,
'nullable' => $joinColumnAnnot->nullable,
'onDelete' => $joinColumnAnnot->onDelete,
'onUpdate' => $joinColumnAnnot->onUpdate
'name' => $joinColumnAnnot->name,
'referencedColumnName' => $joinColumnAnnot->referencedColumnName,
'unique' => $joinColumnAnnot->unique,
'nullable' => $joinColumnAnnot->nullable,
'onDelete' => $joinColumnAnnot->onDelete,
'onUpdate' => $joinColumnAnnot->onUpdate
);
} else if ($joinColumnsAnnot = $property->getAnnotation('JoinColumns')) {
$joinColumns = $joinColumnsAnnot->value;
}
// Field can only be annotated with one of: DoctrineColumn,
// DoctrineOneToOne, DoctrineOneToMany, DoctrineManyToOne, DoctrineManyToMany
// Field can only be annotated with one of:
// @Column, @OneToOne, @OneToMany, @ManyToOne, @ManyToMany
if ($columnAnnot = $property->getAnnotation('Column')) {
if ($columnAnnot->type == null) {
throw DoctrineException::updateMe("Missing type on property " . $property->getName());
......
......@@ -54,7 +54,6 @@ final class Column extends \Annotation {
public $unique = false;
public $nullable = false;
public $name;
//public $quote = false;
}
final class OneToOne extends \Annotation {
public $targetEntity;
......
......@@ -24,7 +24,7 @@ namespace Doctrine\ORM\Mapping\Driver;
use Doctrine\ORM\Mapping\ClassMetadata;
/**
* SchemaMetadata mapping driver interface
* Contract for metadata drivers.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.com
......
......@@ -202,7 +202,7 @@ final class Query extends AbstractQuery
* Defines a cache driver to be used for caching queries.
*
* @param Doctrine_Cache_Interface|null $driver Cache driver
* @return Doctrine_ORM_Query
* @return Query This query instance.
*/
public function setQueryCacheDriver($queryCache)
{
......@@ -229,7 +229,7 @@ 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
* @return Doctrine_ORM_Query
* @return Query This query instance.
*/
public function setQueryCacheLifetime($timeToLive)
{
......@@ -255,7 +255,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 Doctrine_ORM_Query
* @return Query This query instance.
*/
public function setExpireQueryCache($expire = true)
{
......
......@@ -26,7 +26,8 @@ namespace Doctrine\ORM\Query\AST;
* NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
* EnumPrimary | SimpleEntityExpression | "NULL"
*
* @author robo
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class UpdateItem extends Node
{
......
......@@ -32,6 +32,7 @@ use Doctrine\Common\DoctrineException;
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
* @todo Code review for identifier quoting.
* @todo Code review for schema usage with table names.
*/
class SqlWalker implements TreeWalker
{
......
......@@ -1536,8 +1536,8 @@ class UnitOfWork implements PropertyChangedListener
$this->_entityUpdates[$oid] = $entity;
} else if ($oldValue instanceof PersistentCollection) {
// A PersistentCollection was de-referenced, so delete it.
if ( ! in_array($orgValue, $this->_collectionDeletions, true)) {
$this->_collectionDeletions[] = $orgValue;
if ( ! in_array($oldValue, $this->_collectionDeletions, true)) {
$this->_collectionDeletions[] = $oldValue;
}
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment