Changeset 4792 for trunk/tests/models

Show
Ignore:
Timestamp:
08/22/08 10:37:03 (5 months ago)
Author:
romanb
Message:

added mapping check to onetomany. corrected test models.

Location:
trunk/tests/models
Files:
4 modified

Legend:

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

    r4789 r4792  
    4040            'fieldName' => 'comments', 
    4141            'targetEntity' => 'CmsComment', 
     42            'mappedBy' => 'article' 
    4243        )); 
    4344         
  • trunk/tests/models/cms/CmsComment.php

    r4699 r4792  
    3535            'length' => 4 
    3636        )); 
     37         
     38        $mapping->mapManyToOne(array( 
     39            'fieldName' => 'article', 
     40            'targetEntity' => 'CmsArticle', 
     41            'joinColumns' => array('article_id' => 'id') 
     42        )); 
    3743    } 
    3844} 
  • trunk/tests/models/forum/ForumBoard.php

    r4776 r4792  
    2525            'type' => 'integer' 
    2626        )); 
    27          
    28         /*$mapping->hasOne('ForumCategory as category', 
    29                 array('local' => 'category_id', 'foreign' => 'id'));*/ 
    3027                
    31         $mapping->mapOneToOne(array( 
     28        $mapping->mapManyToOne(array( 
    3229            'fieldName' => 'category', 
    3330            'targetEntity' => 'ForumCategory', 
  • trunk/tests/models/forum/ForumCategory.php

    r4776 r4792  
    2121        )); 
    2222         
    23         /*$mapping->hasMany('ForumBoard as boards', array( 
    24                 'local' => 'id' , 'foreign' => 'category_id'));*/ 
    25          
    2623        $mapping->mapOneToMany(array( 
    2724            'fieldName' => 'boards', 
    28             'targetEntity' => 'ForumBoard' 
     25            'targetEntity' => 'ForumBoard', 
     26            'mappedBy' => 'category' 
    2927        )); 
    3028    }