Changeset 4776 for trunk/tests/models

Show
Ignore:
Timestamp:
08/16/08 20:40:59 (5 months ago)
Author:
romanb
Message:

continued refactorings.

Location:
trunk/tests/models
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/models/cms/CmsArticle.php

    r4718 r4776  
    3535            'length' => 4 
    3636        )); 
    37         $mapping->hasMany('CmsComment as comments', array( 
    38               'local' => 'id', 'foreign' => 'article_id')); 
     37         
     38        /*$mapping->hasMany('CmsComment as comments', array( 
     39              'local' => 'id', 'foreign' => 'article_id'));*/ 
     40         
     41        $mapping->mapOneToMany(array( 
     42            'fieldName' => 'comments', 
     43            'targetEntity' => 'CmsComment', 
     44        )); 
     45         
     46        /*$mapping->mapManyToOne(array( 
     47            'fieldName' => 'author', 
     48            'joinColumns' => array('user_id' => 'id') 
     49        ));*/ 
    3950    } 
    4051} 
  • trunk/tests/models/cms/CmsUser.php

    r4718 r4776  
    3737        )); 
    3838 
    39         $mapping->hasMany('CmsPhonenumber as phonenumbers', array( 
     39        /*$mapping->hasMany('CmsPhonenumber as phonenumbers', array( 
    4040              'local' => 'id', 'foreign' => 'user_id')); 
    4141        $mapping->hasMany('CmsArticle as articles', array( 
    42               'local' => 'id', 'foreign' => 'user_id')); 
     42              'local' => 'id', 'foreign' => 'user_id'));*/ 
     43         
     44        $mapping->mapOneToMany(array( 
     45            'fieldName' => 'phonenumbers', 
     46            'targetEntity' => 'CmsPhonenumber', 
     47             
     48        )); 
     49         
     50        $mapping->mapOneToMany(array( 
     51            'fieldName' => 'articles', 
     52            'targetEntity' => 'CmsArticle', 
     53        )); 
     54         
    4355    } 
    4456} 
  • trunk/tests/models/forum/ForumBoard.php

    r4699 r4776  
    2626        )); 
    2727         
    28         $mapping->hasOne('ForumCategory as category', 
    29                 array('local' => 'category_id', 'foreign' => 'id')); 
    30         /*        
    31         $metadata->mapOneToOne(array( 
    32             'fieldName' => 'category', // optional, defaults to targetEntity 
     28        /*$mapping->hasOne('ForumCategory as category', 
     29                array('local' => 'category_id', 'foreign' => 'id'));*/ 
     30                
     31        $mapping->mapOneToOne(array( 
     32            'fieldName' => 'category', 
    3333            'targetEntity' => 'ForumCategory', 
    3434            'joinColumns' => array('category_id' => 'id') 
    35             ));  
    36         */        
     35        )); 
    3736    } 
    3837} 
  • trunk/tests/models/forum/ForumCategory.php

    r4699 r4776  
    2121        )); 
    2222         
    23         $mapping->hasMany('ForumBoard as boards', array( 
    24                 'local' => 'id' , 'foreign' => 'category_id'));  
     23        /*$mapping->hasMany('ForumBoard as boards', array( 
     24                'local' => 'id' , 'foreign' => 'category_id'));*/ 
     25         
     26        $mapping->mapOneToMany(array( 
     27            'fieldName' => 'boards', 
     28            'targetEntity' => 'ForumBoard' 
     29        )); 
    2530    } 
    2631} 
  • trunk/tests/models/forum/ForumUser.php

    r4718 r4776  
    77class ForumUser extends Doctrine_Entity 
    88{ 
    9     #protected $dtype; 
    109    #protected $id; 
    1110    #protected $username; 
     11    #protected $avatar; 
    1212     
    1313    public static function initMetadata($mapping)  
     
    4343        )); 
    4444         
     45        $mapping->mapOneToOne(array( 
     46            'fieldName' => 'avatar', 
     47            'targetEntity' => 'ForumAvatar', 
     48            'joinColumns' => array('avatar_id' => 'id'), 
     49        )); 
     50         
    4551    } 
    4652