Changeset 4033
- Timestamp:
- 03/19/08 01:51:50 (16 months ago)
- Location:
- branches/0.10
- Files:
-
- 13 modified
-
lib/Doctrine/Collection.php (modified) (1 diff)
-
lib/Doctrine/Locking/Manager/Pessimistic.php (modified) (3 diffs)
-
models/M2MTest.php (modified) (1 diff)
-
models/M2MTest2.php (modified) (1 diff)
-
models/MyUser.php (modified) (1 diff)
-
models/MyUserGroup.php (modified) (1 diff)
-
models/Resource.php (modified) (1 diff)
-
models/ResourceType.php (modified) (1 diff)
-
models/RTC1.php (modified) (1 diff)
-
models/RTC2.php (modified) (1 diff)
-
models/RTC3.php (modified) (1 diff)
-
models/RTC4.php (modified) (1 diff)
-
models/Task.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Collection.php
r3914 r4033 505 505 } 506 506 } 507 $query->from($this->_table->getComponentName() . '(' . implode(", ",$this->_table->getPrimaryKeys()) . ')');507 $query->from($this->_table->getComponentName()); 508 508 $query->where($this->_table->getComponentName() . '.id IN (' . substr(str_repeat("?, ", count($list)),0,-2) . ')'); 509 509 -
branches/0.10/lib/Doctrine/Locking/Manager/Pessimistic.php
r3884 r4033 102 102 { 103 103 $objectType = $record->getTable()->getComponentName(); 104 $key = $record-> obtainIdentifier();104 $key = $record->getTable()->getIdentifier(); 105 105 106 106 $gotLock = false; … … 171 171 { 172 172 $objectType = $record->getTable()->getComponentName(); 173 $key = $record-> obtainIdentifier();173 $key = $record->getTable()->getIdentifier(); 174 174 175 175 if (is_array($key)) { … … 242 242 { 243 243 $objectType = $lockedRecord->getTable()->getComponentName(); 244 $key = $lockedRecord-> obtainIdentifier();244 $key = $lockedRecord->getTable()->getIdentifier(); 245 245 return $this->_getLockingUserIdent($objectType, $key); 246 246 } -
branches/0.10/models/M2MTest.php
r2353 r4033 7 7 public function setUp() { 8 8 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')); 13 13 14 14 } -
branches/0.10/models/M2MTest2.php
r2353 r4033 2 2 class M2MTest2 extends Doctrine_Record { 3 3 public function setTableDefinition() { 4 $this->hasColumn('oid', 'integer', 11, array('autoincrement' , 'primary'));4 $this->hasColumn('oid', 'integer', 11, array('autoincrement' => true, 'primary' => true)); 5 5 $this->hasColumn('name', 'string', 20); 6 6 } 7 7 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')); 9 9 } 10 10 } -
branches/0.10/models/MyUser.php
r2353 r4033 1 1 <?php 2 class MyUser extends Doctrine_Record { 3 public function setTableDefinition() { 2 class MyUser extends Doctrine_Record 3 { 4 public function setTableDefinition() 5 { 4 6 $this->hasColumn('name', 'string'); 5 7 } 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'); 9 13 } 10 14 } -
branches/0.10/models/MyUserGroup.php
r2353 r4033 13 13 public function setUp() 14 14 { 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')); 17 17 } 18 18 } -
branches/0.10/models/Resource.php
r3048 r4033 2 2 class Resource extends Doctrine_Record { 3 3 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')); 6 10 } 7 11 public function setTableDefinition() { -
branches/0.10/models/ResourceType.php
r2353 r4033 2 2 class ResourceType extends Doctrine_Record { 3 3 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')); 5 7 } 6 8 public function setTableDefinition() { -
branches/0.10/models/RTC1.php
r2353 r4033 5 5 } 6 6 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')); 8 8 } 9 9 } -
branches/0.10/models/RTC2.php
r2353 r4033 5 5 } 6 6 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')); 8 8 } 9 9 } -
branches/0.10/models/RTC3.php
r2353 r4033 5 5 } 6 6 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')); 9 9 } 10 10 } -
branches/0.10/models/RTC4.php
r2353 r4033 6 6 } 7 7 public function setUp() { 8 $this->hasMany('M2MTest2', 'JC3.c2_id');8 $this->hasMany('M2MTest2', array('local' => 'c1_id', 'foreign' => 'c2_id', 'refClass' => 'JC3')); 9 9 } 10 10 } -
branches/0.10/models/Task.php
r2353 r4033 2 2 class Task extends Doctrine_Record { 3 3 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')); 6 8 } 7 9 public function setTableDefinition() {