From 46e6ada4f98b0f3d2bf12329ca7a460f393a2700 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Mon, 3 Dec 2012 09:36:08 +0000 Subject: [PATCH] Fixed documentation for ORM\Mapping --- .../ORM/Mapping/AssociationOverride.php | 5 +- .../ORM/Mapping/AssociationOverrides.php | 4 +- .../ORM/Mapping/AttributeOverride.php | 1 - .../ORM/Mapping/AttributeOverrides.php | 2 - .../Mapping/Builder/AssociationBuilder.php | 61 +++- .../Mapping/Builder/ClassMetadataBuilder.php | 95 +++-- .../ORM/Mapping/Builder/FieldBuilder.php | 48 ++- .../Builder/ManyToManyAssociationBuilder.php | 27 +- .../Builder/OneToManyAssociationBuilder.php | 6 + .../ORM/Mapping/ChangeTrackingPolicy.php | 4 +- .../ORM/Mapping/ClassMetadataFactory.php | 28 +- .../ORM/Mapping/ClassMetadataInfo.php | 340 +++++++++++++----- lib/Doctrine/ORM/Mapping/Column.php | 52 ++- lib/Doctrine/ORM/Mapping/ColumnResult.php | 4 +- .../ORM/Mapping/CustomIdGenerator.php | 4 +- .../ORM/Mapping/DefaultQuoteStrategy.php | 3 +- .../ORM/Mapping/DiscriminatorColumn.php | 28 +- lib/Doctrine/ORM/Mapping/DiscriminatorMap.php | 4 +- .../ORM/Mapping/Driver/AnnotationDriver.php | 43 ++- .../ORM/Mapping/Driver/DatabaseDriver.php | 46 ++- .../ORM/Mapping/Driver/DriverChain.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php | 2 +- .../ORM/Mapping/Driver/StaticPHPDriver.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 22 +- .../ORM/Mapping/Driver/YamlDriver.php | 18 +- .../ORM/Mapping/ElementCollection.php | 4 +- lib/Doctrine/ORM/Mapping/Entity.php | 9 +- lib/Doctrine/ORM/Mapping/EntityResult.php | 4 +- lib/Doctrine/ORM/Mapping/FieldResult.php | 4 +- lib/Doctrine/ORM/Mapping/GeneratedValue.php | 4 +- lib/Doctrine/ORM/Mapping/Index.php | 9 +- lib/Doctrine/ORM/Mapping/InheritanceType.php | 4 +- lib/Doctrine/ORM/Mapping/JoinColumn.php | 38 +- lib/Doctrine/ORM/Mapping/JoinColumns.php | 4 +- lib/Doctrine/ORM/Mapping/JoinTable.php | 19 +- lib/Doctrine/ORM/Mapping/ManyToMany.php | 4 +- lib/Doctrine/ORM/Mapping/ManyToOne.php | 4 +- lib/Doctrine/ORM/Mapping/MappedSuperclass.php | 4 +- lib/Doctrine/ORM/Mapping/MappingException.php | 330 ++++++++++++++++- lib/Doctrine/ORM/Mapping/NamedNativeQuery.php | 2 - lib/Doctrine/ORM/Mapping/NamedQueries.php | 4 +- lib/Doctrine/ORM/Mapping/NamedQuery.php | 9 +- lib/Doctrine/ORM/Mapping/NamingStrategy.php | 47 +-- lib/Doctrine/ORM/Mapping/OneToMany.php | 4 +- lib/Doctrine/ORM/Mapping/OneToOne.php | 4 +- lib/Doctrine/ORM/Mapping/OrderBy.php | 4 +- lib/Doctrine/ORM/Mapping/QuoteStrategy.php | 74 ++-- .../ORM/Mapping/SequenceGenerator.php | 14 +- .../ORM/Mapping/SqlResultSetMapping.php | 2 - lib/Doctrine/ORM/Mapping/Table.php | 24 +- .../ORM/Mapping/UnderscoreNamingStrategy.php | 11 +- lib/Doctrine/ORM/Mapping/UniqueConstraint.php | 9 +- 52 files changed, 1126 insertions(+), 374 deletions(-) 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..22c53f2f9 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -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 2e9e944f2..346194f38 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -552,7 +552,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) @@ -583,7 +584,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) @@ -613,10 +615,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) { @@ -670,7 +673,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) @@ -711,6 +715,11 @@ class XmlDriver extends FileDriver return $result; } + /** + * @param mixed $element + * + * @return bool + */ protected function evaluateBoolean($element) { $flag = (string)$element; @@ -718,4 +727,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 ea53ef28b..b3028268c 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. @@ -574,7 +574,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) @@ -612,10 +613,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; }