Changeset 6023

Show
Ignore:
Timestamp:
07/08/09 11:25:41 (14 months ago)
Author:
romanb
Message:

[2.0] Migrated AnnotationDriver? to new annotation parser. Removed addendum vendor library.

Location:
trunk
Files:
1 removed
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/Common/Annotations/Lexer.php

    r6014 r6023  
    3838    const T_STRING = 4; 
    3939    const T_IDENTIFIER = 5; 
     40    const T_TRUE = 6; 
     41    const T_FALSE = 7; 
    4042 
    4143    /** 
  • trunk/lib/Doctrine/Common/Annotations/Parser.php

    r6014 r6023  
    11<?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 */ 
    221 
    322namespace Doctrine\Common\Annotations; 
     
    7089        $this->_lexer->moveNext(); 
    7190         
    72         return $this->Annotations(); 
     91        if ($this->_lexer->isNextToken('@')) { 
     92            return $this->Annotations(); 
     93        } 
     94        return array(); 
    7395    } 
    7496 
     
    91113 
    92114        if ( ! $isMatch) { 
    93             $this->syntaxError($token['value']); 
     115            $this->syntaxError($token['value'], $this->_lexer->lookahead['value']); 
    94116        } 
    95117 
     
    103125     * @throws Exception 
    104126     */ 
    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"); 
    108130    } 
    109131     
     
    176198        if ( ! $this->_isNestedAnnotation && $this->_lexer->lookahead != null 
    177199                && $this->_lexer->lookahead['value'] != '(' 
     200                && $this->_lexer->lookahead['value'] != '@' 
    178201                || ! is_subclass_of($name, 'Doctrine\Common\Annotations\Annotation')) { 
    179202            return false; 
     
    203226 
    204227        $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 
    221231            if (is_array($value)) { 
    222232                $k = key($value); 
     
    226236                    $values[$k] = $v; 
    227237                } else { 
    228                     $values['value'][] = $value; 
     238                    $values['value']= $value; 
    229239                } 
    230240            } 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; 
    233262        } 
    234263 
     
    270299                $this->match(Lexer::T_FLOAT); 
    271300                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; 
    272307            default: 
    273308                var_dump($this->_lexer->lookahead); 
  • trunk/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php

    r5973 r6023  
    2323 
    2424use Doctrine\Common\DoctrineException; 
     25use Doctrine\Common\Cache\ArrayCache; 
     26use Doctrine\Common\Annotations\AnnotationReader; 
    2527use Doctrine\ORM\Mapping\ClassMetadata; 
    2628use Doctrine\ORM\Mapping\MappingException; 
    2729 
    28 /* Addendum annotation reflection extensions */ 
    29 if ( ! class_exists('Addendum', false)) { 
    30     require __DIR__ . '/../../../../vendor/addendum/annotations.php'; 
    31 } 
    3230require __DIR__ . '/DoctrineAnnotations.php'; 
    3331 
    3432/** 
    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. 
    3734 * 
    3835 * @author Roman Borschel <roman@code-factory.org> 
     
    4643    public function loadMetadataForClass($className, ClassMetadata $metadata) 
    4744    { 
    48         $annotClass = new \ReflectionAnnotatedClass($className); 
     45        $reader = new AnnotationReader(new ArrayCache); 
     46        $class = $metadata->getReflectionClass(); 
    4947 
    5048        // Evaluate DoctrineEntity annotation 
    51         if (($entityAnnot = $annotClass->getAnnotation('Entity')) === false) { 
     49        if (($entityAnnot = $reader->getClassAnnotation($class, 'Entity')) === null) { 
    5250            throw DoctrineException::updateMe("$className is no entity."); 
    5351        } 
     
    5553 
    5654        // Evaluate DoctrineTable annotation 
    57         if ($tableAnnot = $annotClass->getAnnotation('Table')) { 
     55        if ($tableAnnot = $reader->getClassAnnotation($class, 'Table')) { 
    5856            $metadata->setPrimaryTable(array( 
    5957                'name' => $tableAnnot->name, 
     
    6361 
    6462        // Evaluate InheritanceType annotation 
    65         if ($inheritanceTypeAnnot = $annotClass->getAnnotation('InheritanceType')) { 
     63        if ($inheritanceTypeAnnot = $reader->getClassAnnotation($class, 'InheritanceType')) { 
    6664            $metadata->setInheritanceType(constant('\Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceTypeAnnot->value)); 
    6765        } 
    6866 
    6967        // Evaluate DiscriminatorColumn annotation 
    70         if ($discrColumnAnnot = $annotClass->getAnnotation('DiscriminatorColumn')) { 
     68        if ($discrColumnAnnot = $reader->getClassAnnotation($class, 'DiscriminatorColumn')) { 
    7169            $metadata->setDiscriminatorColumn(array( 
    7270                'name' => $discrColumnAnnot->name, 
     
    7775 
    7876        // Evaluate DiscriminatorValue annotation 
    79         if ($discrValueAnnot = $annotClass->getAnnotation('DiscriminatorValue')) { 
     77        if ($discrValueAnnot = $reader->getClassAnnotation($class, 'DiscriminatorValue')) { 
    8078            $metadata->setDiscriminatorValue($discrValueAnnot->value); 
    8179        } 
    8280 
    8381        // Evaluate DoctrineSubClasses annotation 
    84         if ($subClassesAnnot = $annotClass->getAnnotation('SubClasses')) { 
     82        if ($subClassesAnnot = $reader->getClassAnnotation($class, 'SubClasses')) { 
    8583            $metadata->setSubclasses($subClassesAnnot->value); 
    8684        } 
    8785 
    8886        // Evaluate DoctrineChangeTrackingPolicy annotation 
    89         if ($changeTrackingAnnot = $annotClass->getAnnotation('ChangeTrackingPolicy')) { 
     87        if ($changeTrackingAnnot = $reader->getClassAnnotation($class, 'ChangeTrackingPolicy')) { 
    9088            $metadata->setChangeTrackingPolicy($changeTrackingAnnot->value); 
    9189        } 
    9290 
    9391        // Evaluate annotations on properties/fields 
    94         foreach ($annotClass->getProperties() as $property) { 
     92        foreach ($class->getProperties() as $property) { 
    9593            if ($metadata->hasField($property->getName())) { 
    9694                continue; 
     
    102100            // Check for JoinColummn/JoinColumns annotations 
    103101            $joinColumns = array(); 
    104             if ($joinColumnAnnot = $property->getAnnotation('JoinColumn')) { 
     102            if ($joinColumnAnnot = $reader->getPropertyAnnotation($property, 'JoinColumn')) { 
    105103                $joinColumns[] = array( 
    106104                    'name' => $joinColumnAnnot->name, 
     
    111109                    'onUpdate' => $joinColumnAnnot->onUpdate 
    112110                ); 
    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                } 
    115123            } 
    116124 
    117125            // Field can only be annotated with one of: 
    118126            // @Column, @OneToOne, @OneToMany, @ManyToOne, @ManyToMany 
    119             if ($columnAnnot = $property->getAnnotation('Column')) { 
     127            if ($columnAnnot = $reader->getPropertyAnnotation($property, 'Column')) { 
    120128                if ($columnAnnot->type == null) { 
    121129                    throw DoctrineException::updateMe("Missing type on property " . $property->getName()); 
     
    127135                    $mapping['columnName'] = $columnAnnot->name; 
    128136                } 
    129                 if ($idAnnot = $property->getAnnotation('Id')) { 
     137                if ($idAnnot = $reader->getPropertyAnnotation($property, 'Id')) { 
    130138                    $mapping['id'] = true; 
    131139                } 
    132                 if ($generatedValueAnnot = $property->getAnnotation('GeneratedValue')) { 
     140                if ($generatedValueAnnot = $reader->getPropertyAnnotation($property, 'GeneratedValue')) { 
    133141                    $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $generatedValueAnnot->strategy)); 
    134142                } 
     
    136144 
    137145                // Check for SequenceGenerator/TableGenerator definition 
    138                 if ($seqGeneratorAnnot = $property->getAnnotation('SequenceGenerator')) { 
     146                if ($seqGeneratorAnnot = $reader->getPropertyAnnotation($property, 'SequenceGenerator')) { 
    139147                    $metadata->setSequenceGeneratorDefinition(array( 
    140148                        'sequenceName' => $seqGeneratorAnnot->sequenceName, 
     
    142150                        'initialValue' => $seqGeneratorAnnot->initialValue 
    143151                    )); 
    144                 } else if ($tblGeneratorAnnot = $property->getAnnotation('TableGenerator')) { 
     152                } else if ($tblGeneratorAnnot = $reader->getPropertyAnnotation($property, 'TableGenerator')) { 
    145153                    throw new DoctrineException("DoctrineTableGenerator not yet implemented."); 
    146154                } 
    147155                 
    148             } else if ($oneToOneAnnot = $property->getAnnotation('OneToOne')) { 
     156            } else if ($oneToOneAnnot = $reader->getPropertyAnnotation($property, 'OneToOne')) { 
    149157                $mapping['targetEntity'] = $oneToOneAnnot->targetEntity; 
    150158                $mapping['joinColumns'] = $joinColumns; 
     
    152160                $mapping['cascade'] = $oneToOneAnnot->cascade; 
    153161                $metadata->mapOneToOne($mapping); 
    154             } else if ($oneToManyAnnot = $property->getAnnotation('OneToMany')) { 
     162            } else if ($oneToManyAnnot = $reader->getPropertyAnnotation($property, 'OneToMany')) { 
    155163                $mapping['mappedBy'] = $oneToManyAnnot->mappedBy; 
    156164                $mapping['targetEntity'] = $oneToManyAnnot->targetEntity; 
    157165                $mapping['cascade'] = $oneToManyAnnot->cascade; 
    158166                $metadata->mapOneToMany($mapping); 
    159             } else if ($manyToOneAnnot = $property->getAnnotation('ManyToOne')) { 
     167            } else if ($manyToOneAnnot = $reader->getPropertyAnnotation($property, 'ManyToOne')) { 
    160168                $mapping['joinColumns'] = $joinColumns; 
    161169                $mapping['cascade'] = $manyToOneAnnot->cascade; 
    162170                $mapping['targetEntity'] = $manyToOneAnnot->targetEntity; 
    163171                $metadata->mapManyToOne($mapping); 
    164             } else if ($manyToManyAnnot = $property->getAnnotation('ManyToMany')) { 
     172            } else if ($manyToManyAnnot = $reader->getPropertyAnnotation($property, 'ManyToMany')) { 
    165173                $joinTable = array(); 
    166                 if ($joinTableAnnot = $property->getAnnotation('JoinTable')) { 
     174                if ($joinTableAnnot = $reader->getPropertyAnnotation($property, 'JoinTable')) { 
    167175                    $joinTable = array( 
    168176                        'name' => $joinTableAnnot->name, 
    169177                        'schema' => $joinTableAnnot->schema, 
    170                         'joinColumns' => $joinTableAnnot->joinColumns, 
    171                         'inverseJoinColumns' => $joinTableAnnot->inverseJoinColumns 
     178                        //'joinColumns' => $joinTableAnnot->joinColumns, 
     179                        //'inverseJoinColumns' => $joinTableAnnot->inverseJoinColumns 
    172180                    ); 
    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                 
    174205                $mapping['joinTable'] = $joinTable; 
    175206                $mapping['targetEntity'] = $manyToManyAnnot->targetEntity; 
  • trunk/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php

    r6009 r6023  
    2222/* Annotations */ 
    2323 
    24 final class Entity extends \Annotation { 
     24final class Entity extends \Doctrine\Common\Annotations\Annotation { 
    2525    public $repositoryClass; 
    2626} 
    27 final class InheritanceType extends \Annotation {} 
    28 final class DiscriminatorColumn extends \Annotation { 
     27final class InheritanceType extends \Doctrine\Common\Annotations\Annotation {} 
     28final class DiscriminatorColumn extends \Doctrine\Common\Annotations\Annotation { 
    2929    public $name; 
    3030    public $type; 
    3131    public $length; 
    3232} 
    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 { 
     33final class DiscriminatorValue extends \Doctrine\Common\Annotations\Annotation {} 
     34final class SubClasses extends \Doctrine\Common\Annotations\Annotation {} 
     35final class Id extends \Doctrine\Common\Annotations\Annotation {} 
     36final class GeneratedValue extends \Doctrine\Common\Annotations\Annotation { 
    3837    public $strategy; 
    3938    //public $generator; 
    4039} 
    41 final class Version extends \Annotation {} 
    42 final class JoinColumn extends \Annotation { 
     40final class Version extends \Doctrine\Common\Annotations\Annotation {} 
     41final class JoinColumn extends \Doctrine\Common\Annotations\Annotation { 
    4342    public $name; 
    4443    public $referencedColumnName; 
     
    4847    public $onUpdate; 
    4948} 
    50 final class JoinColumns extends \Annotation {} 
    51 final class Column extends \Annotation { 
     49final class JoinColumns extends \Doctrine\Common\Annotations\Annotation {} 
     50final class Column extends \Doctrine\Common\Annotations\Annotation { 
    5251    public $type; 
    5352    public $length; 
     
    5655    public $name; 
    5756} 
    58 final class OneToOne extends \Annotation { 
     57final class OneToOne extends \Doctrine\Common\Annotations\Annotation { 
    5958    public $targetEntity; 
    6059    public $mappedBy; 
     
    6362    public $optional; 
    6463} 
    65 final class OneToMany extends \Annotation { 
     64final class OneToMany extends \Doctrine\Common\Annotations\Annotation { 
    6665    public $mappedBy; 
    6766    public $targetEntity; 
     
    6968    public $fetch; 
    7069} 
    71 final class ManyToOne extends \Annotation { 
     70final class ManyToOne extends \Doctrine\Common\Annotations\Annotation { 
    7271    public $targetEntity; 
    7372    public $cascade; 
     
    7574    public $optional; 
    7675} 
    77 final class ManyToMany extends \Annotation { 
     76final class ManyToMany extends \Doctrine\Common\Annotations\Annotation { 
    7877    public $targetEntity; 
    7978    public $mappedBy; 
     
    8180    public $fetch; 
    8281} 
    83 final class ElementCollection extends \Annotation { 
     82final class ElementCollection extends \Doctrine\Common\Annotations\Annotation { 
    8483    public $tableName; 
    8584} 
    86 final class Table extends \Annotation { 
     85final class Table extends \Doctrine\Common\Annotations\Annotation { 
    8786    public $name; 
    8887    public $schema; 
    8988} 
    90 final class JoinTable extends \Annotation { 
     89final class JoinTable extends \Doctrine\Common\Annotations\Annotation { 
    9190    public $name; 
    9291    public $schema; 
     
    9493    public $inverseJoinColumns; 
    9594} 
    96 final class SequenceGenerator extends \Annotation { 
     95final class SequenceGenerator extends \Doctrine\Common\Annotations\Annotation { 
    9796    //public $name; 
    9897    public $sequenceName; 
     
    10099    public $initialValue = 1; 
    101100} 
    102 final class ChangeTrackingPolicy extends \Annotation {} 
    103 final class DoctrineX extends \Annotation {} 
     101final class ChangeTrackingPolicy extends \Doctrine\Common\Annotations\Annotation {} 
     102final class DoctrineX extends \Doctrine\Common\Annotations\Annotation {} 
  • trunk/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php

    r6014 r6023  
    3232        $this->assertEquals(1, count($methodAnnots)); 
    3333        $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); 
    3635         
    3736        $field2Prop = $class->getProperty('field2'); 
     
    8281     * 
    8382     * @return mixed 
    84      * @DummyAnnotation({1,2,"three"}, dummyValue="methodHello") 
     83     * @DummyAnnotation({1,2,"three"}) 
    8584     */ 
    8685    public function getField1() { 
  • trunk/tests/Doctrine/Tests/Common/Annotations/ParserTest.php

    r6014 r6023  
    2929         
    3030        // 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}})'); 
    3232        $annot = $result['Doctrine\Tests\Common\Annotations\Name']; 
    33                  
     33 
    3434        $this->assertTrue($annot instanceof Name); 
    35         $this->assertEquals(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])); 
    4040         
    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); 
    5044         
    5145        // Complete docblock 
  • trunk/tests/Doctrine/Tests/Models/CMS/CmsUser.php

    r5993 r6023  
    4141     * @ManyToMany(targetEntity="CmsGroup", cascade={"save"}) 
    4242     * @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")}) 
    4545     */ 
    4646    public $groups; 
  • trunk/tests/Doctrine/Tests/Models/Company/CompanyPerson.php

    r5880 r6023  
    3636     * @ManyToMany(targetEntity="CompanyPerson") 
    3737     * @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")}) 
    4040     */ 
    4141    private $friends; 
  • trunk/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php

    r5995 r6023  
    3636     * @ManyToMany(targetEntity="ECommerceProduct", cascade={"save"}) 
    3737     * @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")}) 
    4040     */ 
    4141    private $products; 
  • trunk/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php

    r6006 r6023  
    4141     * @ManyToMany(targetEntity="ECommerceCategory", cascade={"save"}) 
    4242     * @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")}) 
    4545     */ 
    4646    private $categories; 
     
    5151     * @ManyToMany(targetEntity="ECommerceProduct", cascade={"save"}) 
    5252     * @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")}) 
    5555     */ 
    5656    private $related;