Changeset 4704 for branches/1.0/lib/Doctrine/Record.php
- Timestamp:
- 07/23/08 21:19:40 (6 months ago)
- Files:
-
- 1 modified
-
branches/1.0/lib/Doctrine/Record.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/lib/Doctrine/Record.php
r4652 r4704 79 79 const STATE_LOCKED = 6; 80 80 81 /** 82 * TLOCKED STATE 83 * a Doctrine_Record is temporarily locked (and transient) during deletes and saves 84 * 85 * This state is used internally to ensure that circular deletes 86 * and saves will not cause infinite loops 87 */ 88 const STATE_TLOCKED = 7; 89 90 81 91 /** 82 92 * @var Doctrine_Node_<TreeImpl> node object … … 668 678 $err = false; 669 679 if (is_integer($state)) { 670 if ($state >= 1 && $state <= 6) {680 if ($state >= 1 && $state <= 7) { 671 681 $this->_state = $state; 672 682 } else { … … 1291 1301 public function toArray($deep = true, $prefixKey = false) 1292 1302 { 1293 if ($this->_state == self::STATE_LOCKED ) {1303 if ($this->_state == self::STATE_LOCKED || $this->_state == self::STATE_TLOCKED) { 1294 1304 return false; 1295 1305 } 1296 1306 1297 1307 $stateBeforeLock = $this->_state; 1298 $this->_state = self::STATE_LOCKED;1308 $this->_state = $this->exists() ? self::STATE_LOCKED : self::STATE_TLOCKED; 1299 1309 1300 1310 $a = array(); … … 1465 1475 { 1466 1476 return ($this->_state !== Doctrine_Record::STATE_TCLEAN && 1467 $this->_state !== Doctrine_Record::STATE_TDIRTY); 1477 $this->_state !== Doctrine_Record::STATE_TDIRTY && 1478 $this->_state !== Doctrine_Record::STATE_TLOCKED); 1468 1479 } 1469 1480 … … 1925 1936 public function free($deep = false) 1926 1937 { 1927 if ($this->_state != self::STATE_LOCKED ) {1928 $this->_state = self::STATE_LOCKED;1938 if ($this->_state != self::STATE_LOCKED && $this->_state != self::STATE_TLOCKED) { 1939 $this->_state = $this->exists() ? self::STATE_LOCKED : self::STATE_TLOCKED; 1929 1940 1930 1941 $this->_table->getRepository()->evict($this->_oid);