Changeset 4033

Show
Ignore:
Timestamp:
03/19/08 01:51:50 (16 months ago)
Author:
jwage
Message:

Fixes from commented tests. Updating models to use updated syntax.

Location:
branches/0.10
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Collection.php

    r3914 r4033  
    505505                } 
    506506            } 
    507             $query->from($this->_table->getComponentName() . '(' . implode(", ",$this->_table->getPrimaryKeys()) . ')'); 
     507            $query->from($this->_table->getComponentName()); 
    508508            $query->where($this->_table->getComponentName() . '.id IN (' . substr(str_repeat("?, ", count($list)),0,-2) . ')'); 
    509509 
  • branches/0.10/lib/Doctrine/Locking/Manager/Pessimistic.php

    r3884 r4033  
    102102    { 
    103103        $objectType = $record->getTable()->getComponentName(); 
    104         $key        = $record->obtainIdentifier(); 
     104        $key        = $record->getTable()->getIdentifier(); 
    105105 
    106106        $gotLock = false; 
     
    171171    { 
    172172        $objectType = $record->getTable()->getComponentName(); 
    173         $key        = $record->obtainIdentifier(); 
     173        $key        = $record->getTable()->getIdentifier(); 
    174174 
    175175        if (is_array($key)) { 
     
    242242    { 
    243243        $objectType = $lockedRecord->getTable()->getComponentName(); 
    244         $key        = $lockedRecord->obtainIdentifier(); 
     244        $key        = $lockedRecord->getTable()->getIdentifier(); 
    245245        return $this->_getLockingUserIdent($objectType, $key); 
    246246    } 
  • branches/0.10/models/M2MTest.php

    r2353 r4033  
    77    public function setUp() { 
    88 
    9         $this->hasMany('RTC1 as RTC1', 'JC1.c1_id'); 
    10         $this->hasMany('RTC2 as RTC2', 'JC1.c1_id'); 
    11         $this->hasMany('RTC3 as RTC3', 'JC2.c1_id'); 
    12         $this->hasMany('RTC3 as RTC4', 'JC1.c1_id'); 
     9        $this->hasMany('RTC1 as RTC1', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 
     10        $this->hasMany('RTC2 as RTC2', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 
     11        $this->hasMany('RTC3 as RTC3', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC2')); 
     12        $this->hasMany('RTC3 as RTC4', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC1')); 
    1313 
    1414    } 
  • branches/0.10/models/M2MTest2.php

    r2353 r4033  
    22class M2MTest2 extends Doctrine_Record { 
    33    public function setTableDefinition() { 
    4         $this->hasColumn('oid', 'integer', 11, array('autoincrement', 'primary')); 
     4        $this->hasColumn('oid', 'integer', 11, array('autoincrement' => true, 'primary' => true)); 
    55        $this->hasColumn('name', 'string', 20); 
    66    } 
    77    public function setUp() { 
    8         $this->hasMany('RTC4 as RTC5', 'JC3.c1_id'); 
     8        $this->hasMany('RTC4 as RTC5', array('local' => 'c1_id', 'foreign' => 'c1_id', 'refClass' => 'JC3')); 
    99    } 
    1010} 
  • branches/0.10/models/MyUser.php

    r2353 r4033  
    11<?php 
    2 class MyUser extends Doctrine_Record { 
    3     public function setTableDefinition() { 
     2class MyUser extends Doctrine_Record 
     3{ 
     4    public function setTableDefinition() 
     5    { 
    46        $this->hasColumn('name', 'string'); 
    57    } 
    6     public function setUp() { 
    7                 $this->hasMany('MyOneThing', 'MyOneThing.user_id'); 
    8                 $this->hasMany('MyOtherThing', 'MyOtherThing.user_id'); 
     8     
     9    public function setUp() 
     10    { 
     11                  $this->hasMany('MyOneThing', 'MyOneThing.user_id'); 
     12                  $this->hasMany('MyOtherThing', 'MyOtherThing.user_id'); 
    913    } 
    1014} 
  • branches/0.10/models/MyUserGroup.php

    r2353 r4033  
    1313    public function setUp() 
    1414    { 
    15         $this->hasOne('MyGroup as MyGroup', 'MyUserGroup.group_id'); 
    16         $this->hasOne('MyUser as MyUser', 'MyUserGroup.user_id'); 
     15        $this->hasOne('MyGroup as MyGroup', array('local' => 'group_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 
     16        $this->hasOne('MyUser as MyUser', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); 
    1717    } 
    1818} 
  • branches/0.10/models/Resource.php

    r3048 r4033  
    22class Resource extends Doctrine_Record { 
    33   public function setUp() { 
    4       $this->hasMany('Task as TaskAlias', 'Assignment.task_id'); 
    5       $this->hasMany('ResourceType as Type', 'ResourceReference.type_id'); 
     4      $this->hasMany('Task as TaskAlias', array('local'     =>  'resource_id', 
     5                                                'foreign'   =>  'task_id', 
     6                                                'refClass'  =>  'Assignment')); 
     7      $this->hasMany('ResourceType as Type', array('local'    => 'resource_id', 
     8                                                   'foreign'  => 'type_id', 
     9                                                   'refClass' => 'ResourceReference')); 
    610   } 
    711   public function setTableDefinition() { 
  • branches/0.10/models/ResourceType.php

    r2353 r4033  
    22class ResourceType extends Doctrine_Record { 
    33    public function setUp() { 
    4         $this->hasMany('Resource as ResourceAlias', 'ResourceReference.resource_id'); 
     4        $this->hasMany('Resource as ResourceAlias', array('local'    => 'type_id', 
     5                                                          'foreign'  => 'resource_id', 
     6                                                          'refClass' => 'ResourceReference')); 
    57    } 
    68    public function setTableDefinition() { 
  • branches/0.10/models/RTC1.php

    r2353 r4033  
    55    } 
    66    public function setUp() { 
    7         $this->hasMany('M2MTest as RTC1', 'JC1.c2_id'); 
     7        $this->hasMany('M2MTest as RTC1', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 
    88    } 
    99} 
  • branches/0.10/models/RTC2.php

    r2353 r4033  
    55    } 
    66    public function setUp() { 
    7         $this->hasMany('M2MTest as RTC2', 'JC1.c2_id'); 
     7        $this->hasMany('M2MTest as RTC2', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 
    88    } 
    99} 
  • branches/0.10/models/RTC3.php

    r2353 r4033  
    55    } 
    66    public function setUp() { 
    7         $this->hasMany('M2MTest as RTC3', 'JC2.c2_id'); 
    8         $this->hasMany('M2MTest as RTC4', 'JC1.c2_id'); 
     7        $this->hasMany('M2MTest as RTC3', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC2')); 
     8        $this->hasMany('M2MTest as RTC4', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC1')); 
    99    } 
    1010} 
  • branches/0.10/models/RTC4.php

    r2353 r4033  
    66    } 
    77    public function setUp() { 
    8         $this->hasMany('M2MTest2', 'JC3.c2_id'); 
     8        $this->hasMany('M2MTest2', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC3')); 
    99    } 
    1010} 
  • branches/0.10/models/Task.php

    r2353 r4033  
    22class Task extends Doctrine_Record { 
    33   public function setUp() { 
    4       $this->hasMany('Resource as ResourceAlias', 'Assignment.resource_id'); 
    5       $this->hasMany('Task as Subtask', 'Subtask.parent_id'); 
     4      $this->hasMany('Resource as ResourceAlias', array('local'     =>  'task_id', 
     5                                                        'foreign'   =>  'resource_id', 
     6                                                        'refClass'  =>  'Assignment')); 
     7      $this->hasMany('Task as Subtask', array('local' => 'id', 'foreign' => 'parent_id')); 
    68   }  
    79   public function setTableDefinition() {