Changeset 6023
- Timestamp:
- 07/08/09 11:25:41 (14 months ago)
- Location:
- trunk
- Files:
-
- 1 removed
- 10 modified
-
lib/Doctrine/Common/Annotations/Lexer.php (modified) (1 diff)
-
lib/Doctrine/Common/Annotations/Parser.php (modified) (8 diffs)
-
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (modified) (11 diffs)
-
lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php (modified) (9 diffs)
-
lib/vendor/addendum (deleted)
-
tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php (modified) (2 diffs)
-
tests/Doctrine/Tests/Common/Annotations/ParserTest.php (modified) (1 diff)
-
tests/Doctrine/Tests/Models/CMS/CmsUser.php (modified) (1 diff)
-
tests/Doctrine/Tests/Models/Company/CompanyPerson.php (modified) (1 diff)
-
tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php (modified) (1 diff)
-
tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine/Common/Annotations/Lexer.php
r6014 r6023 38 38 const T_STRING = 4; 39 39 const T_IDENTIFIER = 5; 40 const T_TRUE = 6; 41 const T_FALSE = 7; 40 42 41 43 /** -
trunk/lib/Doctrine/Common/Annotations/Parser.php
r6014 r6023 1 1 <?php 2 /* 3 * $Id$ 4 * 5 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 6 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 7 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 8 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 9 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 10 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 11 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 12 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 13 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 14 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 15 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 * 17 * This software consists of voluntary contributions made by many individuals 18 * and is licensed under the LGPL. For more information, see 19 * <http://www.doctrine-project.org>. 20 */ 2 21 3 22 namespace Doctrine\Common\Annotations; … … 70 89 $this->_lexer->moveNext(); 71 90 72 return $this->Annotations(); 91 if ($this->_lexer->isNextToken('@')) { 92 return $this->Annotations(); 93 } 94 return array(); 73 95 } 74 96 … … 91 113 92 114 if ( ! $isMatch) { 93 $this->syntaxError($token['value'] );115 $this->syntaxError($token['value'], $this->_lexer->lookahead['value']); 94 116 } 95 117 … … 103 125 * @throws Exception 104 126 */ 105 private function syntaxError($expected )106 { 107 throw new \Exception("Expected: $expected. ");127 private function syntaxError($expected, $got = "") 128 { 129 throw new \Exception("Expected: $expected. Got: $got"); 108 130 } 109 131 … … 176 198 if ( ! $this->_isNestedAnnotation && $this->_lexer->lookahead != null 177 199 && $this->_lexer->lookahead['value'] != '(' 200 && $this->_lexer->lookahead['value'] != '@' 178 201 || ! is_subclass_of($name, 'Doctrine\Common\Annotations\Annotation')) { 179 202 return false; … … 203 226 204 227 $value = $this->Value(); 205 if (is_array($value)) { 206 $k = key($value); 207 $v = $value[$k]; 208 if (is_string($k)) { 209 // FieldAssignment 210 $values[$k] = $v; 211 } else { 212 $values['value'][] = $value; 213 } 214 } else { 215 $values['value'][] = $value; 216 } 217 218 while ($this->_lexer->isNextToken(',')) { 219 $this->match(','); 220 $value = $this->Value(); 228 229 if ($this->_lexer->isNextToken(')')) { 230 // Single value 221 231 if (is_array($value)) { 222 232 $k = key($value); … … 226 236 $values[$k] = $v; 227 237 } else { 228 $values['value'] []= $value;238 $values['value']= $value; 229 239 } 230 240 } else { 231 $values['value'][] = $value; 232 } 241 $values['value'] = $value; 242 } 243 return $values; 244 } else { 245 // FieldAssignment 246 $k = key($value); 247 $v = $value[$k]; 248 $values[$k] = $v; 249 } 250 251 while ($this->_lexer->isNextToken(',')) { 252 $this->match(','); 253 $value = $this->Value(); 254 255 if ( ! is_array($value)) { 256 $this->syntaxError('FieldAssignment', $value); 257 } 258 259 $k = key($value); 260 $v = $value[$k]; 261 $values[$k] = $v; 233 262 } 234 263 … … 270 299 $this->match(Lexer::T_FLOAT); 271 300 return $this->_lexer->token['value']; 301 case Lexer::T_TRUE: 302 $this->match(Lexer::T_TRUE); 303 return true; 304 case Lexer::T_FALSE: 305 $this->match(Lexer::T_FALSE); 306 return false; 272 307 default: 273 308 var_dump($this->_lexer->lookahead); -
trunk/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
r5973 r6023 23 23 24 24 use Doctrine\Common\DoctrineException; 25 use Doctrine\Common\Cache\ArrayCache; 26 use Doctrine\Common\Annotations\AnnotationReader; 25 27 use Doctrine\ORM\Mapping\ClassMetadata; 26 28 use Doctrine\ORM\Mapping\MappingException; 27 29 28 /* Addendum annotation reflection extensions */29 if ( ! class_exists('Addendum', false)) {30 require __DIR__ . '/../../../../vendor/addendum/annotations.php';31 }32 30 require __DIR__ . '/DoctrineAnnotations.php'; 33 31 34 32 /** 35 * The AnnotationDriver reads the mapping metadata from docblock annotations 36 * with the help of the Addendum reflection extensions. 33 * The AnnotationDriver reads the mapping metadata from docblock annotations. 37 34 * 38 35 * @author Roman Borschel <roman@code-factory.org> … … 46 43 public function loadMetadataForClass($className, ClassMetadata $metadata) 47 44 { 48 $annotClass = new \ReflectionAnnotatedClass($className); 45 $reader = new AnnotationReader(new ArrayCache); 46 $class = $metadata->getReflectionClass(); 49 47 50 48 // Evaluate DoctrineEntity annotation 51 if (($entityAnnot = $ annotClass->getAnnotation('Entity')) === false) {49 if (($entityAnnot = $reader->getClassAnnotation($class, 'Entity')) === null) { 52 50 throw DoctrineException::updateMe("$className is no entity."); 53 51 } … … 55 53 56 54 // Evaluate DoctrineTable annotation 57 if ($tableAnnot = $ annotClass->getAnnotation('Table')) {55 if ($tableAnnot = $reader->getClassAnnotation($class, 'Table')) { 58 56 $metadata->setPrimaryTable(array( 59 57 'name' => $tableAnnot->name, … … 63 61 64 62 // Evaluate InheritanceType annotation 65 if ($inheritanceTypeAnnot = $ annotClass->getAnnotation('InheritanceType')) {63 if ($inheritanceTypeAnnot = $reader->getClassAnnotation($class, 'InheritanceType')) { 66 64 $metadata->setInheritanceType(constant('\Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value)); 67 65 } 68 66 69 67 // Evaluate DiscriminatorColumn annotation 70 if ($discrColumnAnnot = $ annotClass->getAnnotation('DiscriminatorColumn')) {68 if ($discrColumnAnnot = $reader->getClassAnnotation($class, 'DiscriminatorColumn')) { 71 69 $metadata->setDiscriminatorColumn(array( 72 70 'name' => $discrColumnAnnot->name, … … 77 75 78 76 // Evaluate DiscriminatorValue annotation 79 if ($discrValueAnnot = $ annotClass->getAnnotation('DiscriminatorValue')) {77 if ($discrValueAnnot = $reader->getClassAnnotation($class, 'DiscriminatorValue')) { 80 78 $metadata->setDiscriminatorValue($discrValueAnnot->value); 81 79 } 82 80 83 81 // Evaluate DoctrineSubClasses annotation 84 if ($subClassesAnnot = $ annotClass->getAnnotation('SubClasses')) {82 if ($subClassesAnnot = $reader->getClassAnnotation($class, 'SubClasses')) { 85 83 $metadata->setSubclasses($subClassesAnnot->value); 86 84 } 87 85 88 86 // Evaluate DoctrineChangeTrackingPolicy annotation 89 if ($changeTrackingAnnot = $ annotClass->getAnnotation('ChangeTrackingPolicy')) {87 if ($changeTrackingAnnot = $reader->getClassAnnotation($class, 'ChangeTrackingPolicy')) { 90 88 $metadata->setChangeTrackingPolicy($changeTrackingAnnot->value); 91 89 } 92 90 93 91 // Evaluate annotations on properties/fields 94 foreach ($ annotClass->getProperties() as $property) {92 foreach ($class->getProperties() as $property) { 95 93 if ($metadata->hasField($property->getName())) { 96 94 continue; … … 102 100 // Check for JoinColummn/JoinColumns annotations 103 101 $joinColumns = array(); 104 if ($joinColumnAnnot = $ property->getAnnotation('JoinColumn')) {102 if ($joinColumnAnnot = $reader->getPropertyAnnotation($property, 'JoinColumn')) { 105 103 $joinColumns[] = array( 106 104 'name' => $joinColumnAnnot->name, … … 111 109 'onUpdate' => $joinColumnAnnot->onUpdate 112 110 ); 113 } else if ($joinColumnsAnnot = $property->getAnnotation('JoinColumns')) { 114 $joinColumns = $joinColumnsAnnot->value; 111 } else if ($joinColumnsAnnot = $reader->getPropertyAnnotation($property, 'JoinColumns')) { 112 foreach ($joinColumnsAnnot->value as $joinColumn) { 113 //$joinColumns = $joinColumnsAnnot->value; 114 $joinColumns[] = array( 115 'name' => $joinColumn->name, 116 'referencedColumnName' => $joinColumn->referencedColumnName, 117 'unique' => $joinColumn->unique, 118 'nullable' => $joinColumn->nullable, 119 'onDelete' => $joinColumn->onDelete, 120 'onUpdate' => $joinColumn->onUpdate 121 ); 122 } 115 123 } 116 124 117 125 // Field can only be annotated with one of: 118 126 // @Column, @OneToOne, @OneToMany, @ManyToOne, @ManyToMany 119 if ($columnAnnot = $ property->getAnnotation('Column')) {127 if ($columnAnnot = $reader->getPropertyAnnotation($property, 'Column')) { 120 128 if ($columnAnnot->type == null) { 121 129 throw DoctrineException::updateMe("Missing type on property " . $property->getName()); … … 127 135 $mapping['columnName'] = $columnAnnot->name; 128 136 } 129 if ($idAnnot = $ property->getAnnotation('Id')) {137 if ($idAnnot = $reader->getPropertyAnnotation($property, 'Id')) { 130 138 $mapping['id'] = true; 131 139 } 132 if ($generatedValueAnnot = $ property->getAnnotation('GeneratedValue')) {140 if ($generatedValueAnnot = $reader->getPropertyAnnotation($property, 'GeneratedValue')) { 133 141 $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy)); 134 142 } … … 136 144 137 145 // Check for SequenceGenerator/TableGenerator definition 138 if ($seqGeneratorAnnot = $ property->getAnnotation('SequenceGenerator')) {146 if ($seqGeneratorAnnot = $reader->getPropertyAnnotation($property, 'SequenceGenerator')) { 139 147 $metadata->setSequenceGeneratorDefinition(array( 140 148 'sequenceName' => $seqGeneratorAnnot->sequenceName, … … 142 150 'initialValue' => $seqGeneratorAnnot->initialValue 143 151 )); 144 } else if ($tblGeneratorAnnot = $ property->getAnnotation('TableGenerator')) {152 } else if ($tblGeneratorAnnot = $reader->getPropertyAnnotation($property, 'TableGenerator')) { 145 153 throw new DoctrineException("DoctrineTableGenerator not yet implemented."); 146 154 } 147 155 148 } else if ($oneToOneAnnot = $ property->getAnnotation('OneToOne')) {156 } else if ($oneToOneAnnot = $reader->getPropertyAnnotation($property, 'OneToOne')) { 149 157 $mapping['targetEntity'] = $oneToOneAnnot->targetEntity; 150 158 $mapping['joinColumns'] = $joinColumns; … … 152 160 $mapping['cascade'] = $oneToOneAnnot->cascade; 153 161 $metadata->mapOneToOne($mapping); 154 } else if ($oneToManyAnnot = $ property->getAnnotation('OneToMany')) {162 } else if ($oneToManyAnnot = $reader->getPropertyAnnotation($property, 'OneToMany')) { 155 163 $mapping['mappedBy'] = $oneToManyAnnot->mappedBy; 156 164 $mapping['targetEntity'] = $oneToManyAnnot->targetEntity; 157 165 $mapping['cascade'] = $oneToManyAnnot->cascade; 158 166 $metadata->mapOneToMany($mapping); 159 } else if ($manyToOneAnnot = $ property->getAnnotation('ManyToOne')) {167 } else if ($manyToOneAnnot = $reader->getPropertyAnnotation($property, 'ManyToOne')) { 160 168 $mapping['joinColumns'] = $joinColumns; 161 169 $mapping['cascade'] = $manyToOneAnnot->cascade; 162 170 $mapping['targetEntity'] = $manyToOneAnnot->targetEntity; 163 171 $metadata->mapManyToOne($mapping); 164 } else if ($manyToManyAnnot = $ property->getAnnotation('ManyToMany')) {172 } else if ($manyToManyAnnot = $reader->getPropertyAnnotation($property, 'ManyToMany')) { 165 173 $joinTable = array(); 166 if ($joinTableAnnot = $ property->getAnnotation('JoinTable')) {174 if ($joinTableAnnot = $reader->getPropertyAnnotation($property, 'JoinTable')) { 167 175 $joinTable = array( 168 176 'name' => $joinTableAnnot->name, 169 177 'schema' => $joinTableAnnot->schema, 170 'joinColumns' => $joinTableAnnot->joinColumns,171 'inverseJoinColumns' => $joinTableAnnot->inverseJoinColumns178 //'joinColumns' => $joinTableAnnot->joinColumns, 179 //'inverseJoinColumns' => $joinTableAnnot->inverseJoinColumns 172 180 ); 173 } 181 182 foreach ($joinTableAnnot->joinColumns as $joinColumn) { 183 $joinTable['joinColumns'][] = array( 184 'name' => $joinColumn->name, 185 'referencedColumnName' => $joinColumn->referencedColumnName, 186 'unique' => $joinColumn->unique, 187 'nullable' => $joinColumn->nullable, 188 'onDelete' => $joinColumn->onDelete, 189 'onUpdate' => $joinColumn->onUpdate 190 ); 191 } 192 193 foreach ($joinTableAnnot->inverseJoinColumns as $joinColumn) { 194 $joinTable['inverseJoinColumns'][] = array( 195 'name' => $joinColumn->name, 196 'referencedColumnName' => $joinColumn->referencedColumnName, 197 'unique' => $joinColumn->unique, 198 'nullable' => $joinColumn->nullable, 199 'onDelete' => $joinColumn->onDelete, 200 'onUpdate' => $joinColumn->onUpdate 201 ); 202 } 203 } 204 174 205 $mapping['joinTable'] = $joinTable; 175 206 $mapping['targetEntity'] = $manyToManyAnnot->targetEntity; -
trunk/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php
r6009 r6023 22 22 /* Annotations */ 23 23 24 final class Entity extends \ Annotation {24 final class Entity extends \Doctrine\Common\Annotations\Annotation { 25 25 public $repositoryClass; 26 26 } 27 final class InheritanceType extends \ Annotation {}28 final class DiscriminatorColumn extends \ Annotation {27 final class InheritanceType extends \Doctrine\Common\Annotations\Annotation {} 28 final class DiscriminatorColumn extends \Doctrine\Common\Annotations\Annotation { 29 29 public $name; 30 30 public $type; 31 31 public $length; 32 32 } 33 //final class DiscriminatorMap extends \Annotation {} 34 final class DiscriminatorValue extends \Annotation {} 35 final class SubClasses extends \Annotation {} 36 final class Id extends \Annotation {} 37 final class GeneratedValue extends \Annotation { 33 final class DiscriminatorValue extends \Doctrine\Common\Annotations\Annotation {} 34 final class SubClasses extends \Doctrine\Common\Annotations\Annotation {} 35 final class Id extends \Doctrine\Common\Annotations\Annotation {} 36 final class GeneratedValue extends \Doctrine\Common\Annotations\Annotation { 38 37 public $strategy; 39 38 //public $generator; 40 39 } 41 final class Version extends \ Annotation {}42 final class JoinColumn extends \ Annotation {40 final class Version extends \Doctrine\Common\Annotations\Annotation {} 41 final class JoinColumn extends \Doctrine\Common\Annotations\Annotation { 43 42 public $name; 44 43 public $referencedColumnName; … … 48 47 public $onUpdate; 49 48 } 50 final class JoinColumns extends \ Annotation {}51 final class Column extends \ Annotation {49 final class JoinColumns extends \Doctrine\Common\Annotations\Annotation {} 50 final class Column extends \Doctrine\Common\Annotations\Annotation { 52 51 public $type; 53 52 public $length; … … 56 55 public $name; 57 56 } 58 final class OneToOne extends \ Annotation {57 final class OneToOne extends \Doctrine\Common\Annotations\Annotation { 59 58 public $targetEntity; 60 59 public $mappedBy; … … 63 62 public $optional; 64 63 } 65 final class OneToMany extends \ Annotation {64 final class OneToMany extends \Doctrine\Common\Annotations\Annotation { 66 65 public $mappedBy; 67 66 public $targetEntity; … … 69 68 public $fetch; 70 69 } 71 final class ManyToOne extends \ Annotation {70 final class ManyToOne extends \Doctrine\Common\Annotations\Annotation { 72 71 public $targetEntity; 73 72 public $cascade; … … 75 74 public $optional; 76 75 } 77 final class ManyToMany extends \ Annotation {76 final class ManyToMany extends \Doctrine\Common\Annotations\Annotation { 78 77 public $targetEntity; 79 78 public $mappedBy; … … 81 80 public $fetch; 82 81 } 83 final class ElementCollection extends \ Annotation {82 final class ElementCollection extends \Doctrine\Common\Annotations\Annotation { 84 83 public $tableName; 85 84 } 86 final class Table extends \ Annotation {85 final class Table extends \Doctrine\Common\Annotations\Annotation { 87 86 public $name; 88 87 public $schema; 89 88 } 90 final class JoinTable extends \ Annotation {89 final class JoinTable extends \Doctrine\Common\Annotations\Annotation { 91 90 public $name; 92 91 public $schema; … … 94 93 public $inverseJoinColumns; 95 94 } 96 final class SequenceGenerator extends \ Annotation {95 final class SequenceGenerator extends \Doctrine\Common\Annotations\Annotation { 97 96 //public $name; 98 97 public $sequenceName; … … 100 99 public $initialValue = 1; 101 100 } 102 final class ChangeTrackingPolicy extends \ Annotation {}103 final class DoctrineX extends \ Annotation {}101 final class ChangeTrackingPolicy extends \Doctrine\Common\Annotations\Annotation {} 102 final class DoctrineX extends \Doctrine\Common\Annotations\Annotation {} -
trunk/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php
r6014 r6023 32 32 $this->assertEquals(1, count($methodAnnots)); 33 33 $this->assertTrue($methodAnnots[$annotName] instanceof DummyAnnotation); 34 $this->assertEquals("methodHello", $methodAnnots[$annotName]->dummyValue); 35 $this->assertEquals(array(array(1, 2, "three")), $methodAnnots[$annotName]->value); 34 $this->assertEquals(array(1, 2, "three"), $methodAnnots[$annotName]->value); 36 35 37 36 $field2Prop = $class->getProperty('field2'); … … 82 81 * 83 82 * @return mixed 84 * @DummyAnnotation({1,2,"three"} , dummyValue="methodHello")83 * @DummyAnnotation({1,2,"three"}) 85 84 */ 86 85 public function getField1() { -
trunk/tests/Doctrine/Tests/Common/Annotations/ParserTest.php
r6014 r6023 29 29 30 30 // Nested arrays with nested annotations 31 $result = $parser->parse('@Name(foo= 1, 2, 3,{1,2, {"key"=@Name}})');31 $result = $parser->parse('@Name(foo={1,2, {"key"=@Name}})'); 32 32 $annot = $result['Doctrine\Tests\Common\Annotations\Name']; 33 33 34 34 $this->assertTrue($annot instanceof Name); 35 $this->assert Equals(3, count($annot->value));36 $this->assertEquals( 1, $annot->foo);37 $this->assertEquals( 2, $annot->value[0]);38 $this->assertEquals( 3, $annot->value[1]);39 $this->assertTrue(is_array($annot-> value[2]));35 $this->assertNull($annot->value); 36 $this->assertEquals(3, count($annot->foo)); 37 $this->assertEquals(1, $annot->foo[0]); 38 $this->assertEquals(2, $annot->foo[1]); 39 $this->assertTrue(is_array($annot->foo[2])); 40 40 41 $nestedArray = $annot->value[2]; 42 $this->assertEquals(3, count($nestedArray)); 43 $this->assertEquals(1, $nestedArray[0]); 44 $this->assertEquals(2, $nestedArray[1]); 45 $this->assertTrue(is_array($nestedArray[2])); 46 47 $nestedArray2 = $nestedArray[2]; 48 $this->assertTrue(isset($nestedArray2['key'])); 49 $this->assertTrue($nestedArray2['key'] instanceof Name); 41 $nestedArray = $annot->foo[2]; 42 $this->assertTrue(isset($nestedArray['key'])); 43 $this->assertTrue($nestedArray['key'] instanceof Name); 50 44 51 45 // Complete docblock -
trunk/tests/Doctrine/Tests/Models/CMS/CmsUser.php
r5993 r6023 41 41 * @ManyToMany(targetEntity="CmsGroup", cascade={"save"}) 42 42 * @JoinTable(name="cms_users_groups", 43 joinColumns={ {"name"="user_id", "referencedColumnName"="id"}},44 inverseJoinColumns={ {"name"="group_id", "referencedColumnName"="id"}})43 joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, 44 inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")}) 45 45 */ 46 46 public $groups; -
trunk/tests/Doctrine/Tests/Models/Company/CompanyPerson.php
r5880 r6023 36 36 * @ManyToMany(targetEntity="CompanyPerson") 37 37 * @JoinTable(name="company_persons_friends", 38 joinColumns={ {"name"="person_id", "referencedColumnName"="id"}},39 inverseJoinColumns={ {"name"="friend_id", "referencedColumnName"="id"}})38 joinColumns={@JoinColumn(name="person_id", referencedColumnName="id")}, 39 inverseJoinColumns={@JoinColumn(name="friend_id", referencedColumnName="id")}) 40 40 */ 41 41 private $friends; -
trunk/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php
r5995 r6023 36 36 * @ManyToMany(targetEntity="ECommerceProduct", cascade={"save"}) 37 37 * @JoinTable(name="ecommerce_carts_products", 38 joinColumns={ {"name"="cart_id", "referencedColumnName"="id"}},39 inverseJoinColumns={ {"name"="product_id", "referencedColumnName"="id"}})38 joinColumns={@JoinColumn(name="cart_id", referencedColumnName="id")}, 39 inverseJoinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}) 40 40 */ 41 41 private $products; -
trunk/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php
r6006 r6023 41 41 * @ManyToMany(targetEntity="ECommerceCategory", cascade={"save"}) 42 42 * @JoinTable(name="ecommerce_products_categories", 43 joinColumns={ {"name"="product_id", "referencedColumnName"="id"}},44 inverseJoinColumns={ {"name"="category_id", "referencedColumnName"="id"}})43 joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}, 44 inverseJoinColumns={@JoinColumn(name="category_id", referencedColumnName="id")}) 45 45 */ 46 46 private $categories; … … 51 51 * @ManyToMany(targetEntity="ECommerceProduct", cascade={"save"}) 52 52 * @JoinTable(name="ecommerce_products_related", 53 joinColumns={ {"name"="product_id", "referencedColumnName"="id"}},54 inverseJoinColumns={ {"name"="related_id", "referencedColumnName"="id"}})53 joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}, 54 inverseJoinColumns={@JoinColumn(name="related_id", referencedColumnName="id")}) 55 55 */ 56 56 private $related;