- Timestamp:
- 08/21/08 21:45:19 (5 months ago)
- Location:
- trunk/lib/Doctrine
- Files:
-
- 1 added
- 30 modified
-
Entity.php (modified) (33 diffs)
-
Query/AbstractResult.php (modified) (1 diff)
-
Query/Parser.php (modified) (1 diff)
-
Query/Production/BetweenExpression.php (modified) (1 diff)
-
Query/Production/ComparisonExpression.php (modified) (2 diffs)
-
Query/Production/ComparisonOperator.php (modified) (2 diffs)
-
Query/Production/ConditionalExpression.php (modified) (1 diff)
-
Query/Production/ConditionalFactor.php (modified) (1 diff)
-
Query/Production/ConditionalPrimary.php (modified) (1 diff)
-
Query/Production/ConditionalTerm.php (modified) (1 diff)
-
Query/Production/ExistsExpression.php (modified) (1 diff)
-
Query/Production/Expression.php (modified) (1 diff)
-
Query/Production/FieldIdentificationVariable.php (modified) (2 diffs)
-
Query/Production/FromClause.php (modified) (1 diff)
-
Query/Production/IdentificationVariable.php (modified) (1 diff)
-
Query/Production/IdentificationVariableDeclaration.php (modified) (5 diffs)
-
Query/Production/IndexBy.php (modified) (3 diffs)
-
Query/Production/InExpression.php (modified) (1 diff)
-
Query/Production/Join.php (modified) (2 diffs)
-
Query/Production/JoinVariableDeclaration.php (added)
-
Query/Production/LikeExpression.php (modified) (1 diff)
-
Query/Production/NullComparisonExpression.php (modified) (1 diff)
-
Query/Production/PathExpressionEndingWithAsterisk.php (modified) (1 diff)
-
Query/Production/QuantifiedExpression.php (modified) (1 diff)
-
Query/Production/RangeVariableDeclaration.php (modified) (9 diffs)
-
Query/Production/SelectClause.php (modified) (1 diff)
-
Query/Production/SelectExpression.php (modified) (1 diff)
-
Query/Production/SelectStatement.php (modified) (1 diff)
-
Query/Production/SimpleConditionalExpression.php (modified) (1 diff)
-
Query/Production/WhereClause.php (modified) (1 diff)
-
Query/SqlBuilder.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine/Entity.php
r4776 r4785 24 24 /** 25 25 * Base class for all Entities (objects with persistent state in a RDBMS that are 26 * managed by Doctrine). Kind of a Layer Sup tertype.26 * managed by Doctrine). Kind of a Layer Supertype. 27 27 * 28 28 * NOTE: Methods that are intended for internal use only but must be public … … 127 127 * The values that make up the ID/primary key of the entity. 128 128 * 129 * @var array 129 * @var array 130 130 */ 131 131 private $_id = array(); … … 134 134 * The entity data. 135 135 * 136 * @var array 136 * @var array 137 137 */ 138 138 private $_data = array(); … … 174 174 */ 175 175 private $_references = array(); 176 176 177 177 /** 178 178 * The EntityManager that is responsible for the persistent state of the entity. … … 186 186 * during script execution. 187 187 * 188 * @var integer 188 * @var integer 189 189 */ 190 190 private $_oid; 191 191 192 192 /** 193 193 * Flag that indicates whether the entity is dirty. … … 215 215 $this->_state = self::STATE_NEW; 216 216 } 217 217 218 218 // @todo read from attribute the first time and move this initialization elsewhere. 219 219 self::$_useAutoAccessorOverride = true; 220 220 } 221 221 222 222 /** 223 223 * Returns the object identifier. … … 296 296 } 297 297 } 298 298 299 299 $str = serialize($vars); 300 300 … … 331 331 $this->$k = $v; 332 332 } 333 333 334 334 $this->_class = $this->_em->getClassMetadata($this->_entityName); 335 335 … … 351 351 352 352 $this->_extractIdentifier(!$this->isNew()); 353 353 354 354 //$this->postUnserialize($event); 355 355 } … … 376 376 * Gets the current field values. 377 377 * 378 * @return array The fields and their values. 378 * @return array The fields and their values. 379 379 */ 380 380 final public function getData() … … 391 391 */ 392 392 final protected function _get($fieldName) 393 { 393 { 394 394 $nullObj = Doctrine_Null::$INSTANCE; 395 395 if (isset($this->_data[$fieldName])) { … … 416 416 } 417 417 } 418 418 419 419 /** 420 420 * Sets the value of a field (regular field or reference). … … 456 456 } 457 457 } 458 458 459 459 private function _registerDirty() 460 460 { … … 464 464 } 465 465 } 466 466 467 467 /** 468 468 * INTERNAL: … … 483 483 return $this->_data[$fieldName]; 484 484 } 485 485 486 486 /** 487 487 * INTERNAL: … … 499 499 $this->_data[$fieldName] = $value; 500 500 } 501 501 502 502 /** 503 503 * INTERNAL: … … 516 516 return $this->_references[$fieldName]; 517 517 } 518 518 519 519 /** 520 520 * INTERNAL: … … 533 533 return; 534 534 } 535 535 536 536 $rel = $this->_class->getRelation($name); 537 537 … … 576 576 $this->_references[$name] = $value; 577 577 } 578 578 579 579 /** 580 580 * INTERNAL: … … 593 593 return; 594 594 } 595 595 596 596 $rel = $this->_class->getAssociationMapping($name); 597 597 … … 642 642 return $this->_get($fieldName); 643 643 } 644 644 645 645 /** 646 646 * Gets the custom mutator method for a field, if it exists. … … 661 661 } 662 662 } 663 663 664 664 if ($setter = $this->_class->getCustomMutator($fieldName)) { 665 665 self::$_mutatorCache[$this->_entityName][$fieldName] = $setter; … … 668 668 } 669 669 } 670 670 671 671 return self::$_mutatorCache[$this->_entityName][$fieldName]; 672 672 } 673 673 674 674 /** 675 675 * Gets the custom accessor method of a field, if it exists. … … 696 696 } 697 697 } 698 698 699 699 return self::$_accessorCache[$this->_entityName][$fieldName]; 700 700 } 701 701 702 702 /** 703 703 * Gets the entity class name. … … 774 774 } 775 775 } 776 776 777 777 /** 778 778 * INTERNAL: … … 785 785 return $this->_dataChangeSet; 786 786 } 787 787 788 788 final public function _getReferenceChangeSet() 789 789 { 790 790 return $this->_referenceChangeSet; 791 791 } 792 792 793 793 /** 794 794 * Checks whether the entity already has a persistent state. … … 894 894 $this->_references[$alias] = $coll; 895 895 } 896 896 897 897 /** 898 898 * Gets the ClassMetadata object that describes the entity class. … … 904 904 return $this->_class; 905 905 } 906 906 907 907 /** 908 908 * Gets the EntityManager that is responsible for the persistence of … … 915 915 return $this->_em; 916 916 } 917 917 918 918 /** 919 919 * Gets the EntityRepository of the Entity. … … 925 925 return $this->_em->getRepository($this->_entityName); 926 926 } 927 927 928 928 /** 929 929 * @todo Why toString() and __toString() ? … … 942 942 return (string)$this->_oid; 943 943 } 944 944 945 945 /** 946 946 * Helps freeing the memory occupied by the entity. … … 970 970 } 971 971 } 972 972 973 973 /** 974 974 * Check if an offsetExists. … … 1023 1023 return $this->remove($offset); 1024 1024 } 1025 1025 1026 1026 /** 1027 1027 * __set -
trunk/lib/Doctrine/Query/AbstractResult.php
r4451 r4785 124 124 public function getQueryComponent($componentAlias) 125 125 { 126 if ( ! isset($this->_queryComponents[$componentAlias])) {126 if ( ! array_key_exists($componentAlias, $this->_queryComponents)) { 127 127 throw new Doctrine_Query_Exception('Unknown query component ' . $componentAlias); 128 128 } -
trunk/lib/Doctrine/Query/Parser.php
r4725 r4785 174 174 175 175 /** 176 * @todo [TODO] Document these! 176 * Moves the parser scanner to next token 177 * 178 * @return void 177 179 */ 178 180 public function next() -
trunk/lib/Doctrine/Query/Production/BetweenExpression.php
r4523 r4785 66 66 . $this->_fromExpression->buildSql() . ' AND ' . $this->_toExpression->buildSql(); 67 67 } 68 69 /** 70 * Visitor support. 71 * 72 * @param object $visitor 73 */ 74 public function accept($visitor) 75 { 76 $this->_fromExpression->accept($visitor); 77 $this->_toExpression->accept($visitor); 78 $visitor->visitBetweenExpression($this); 79 } 80 68 69 81 70 /* Getters */ 82 83 71 public function isNot() 84 72 { 85 73 return $this->_not; 86 74 } 87 75 76 88 77 public function getFromExpression() 89 78 { 90 79 return $this->_fromExpression; 91 80 } 92 81 82 93 83 public function getToExpression() 94 84 { -
trunk/lib/Doctrine/Query/Production/ComparisonExpression.php
r4523 r4785 25 25 * @package Doctrine 26 26 * @subpackage Query 27 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 27 28 * @author Janne Vanhala <jpvanhal@cc.hut.fi> 28 29 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL … … 72 73 ); 73 74 } 74 75 /** 76 * Visitor support. 77 * 78 * @param object $visitor 79 */ 80 public function accept($visitor) 81 { 82 $this->_expression->accept($visitor); 83 $visitor->visitComparisonExpression($this); 84 } 85 75 76 86 77 /* Getters */ 87 88 78 public function getOperator() 89 79 { 90 80 return $this->_operator; 91 81 } 92 82 83 93 84 public function getExpression() 94 85 { 95 86 return $this->_expression; 96 87 } 97 88 89 98 90 public function isSubselect() 99 91 { -
trunk/lib/Doctrine/Query/Production/ComparisonOperator.php
r4523 r4785 25 25 * @package Doctrine 26 26 * @subpackage Query 27 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 27 28 * @author Janne Vanhala <jpvanhal@cc.hut.fi> 28 29 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL … … 79 80 } 80 81 } 81 82 /**83 * Visitor support.84 *85 * @param object $visitor86 */87 public function accept($visitor)88 {89 $visitor->visitComparisonOperator($this);90 }91 82 } -
trunk/lib/Doctrine/Query/Production/ConditionalExpression.php
r4523 r4785 70 70 return $value->buildSql(); 71 71 } 72 73 /** 74 * Visitor support. 75 * 76 * @param object $visitor 77 */ 78 public function accept($visitor) 79 { 80 foreach ($this->_conditionalTerms as $term) { 81 $term->accept($visitor); 82 } 83 $visitor->visitConditionalExpression($this); 84 } 85 72 73 86 74 /* Getters */ 87 88 75 public function getConditionalTerms() 89 76 { -
trunk/lib/Doctrine/Query/Production/ConditionalFactor.php
r4523 r4785 61 61 return 'NOT ' . $this->_conditionalPrimary->buildSql(); 62 62 } 63 64 /** 65 * Visitor support 66 * 67 * @param object $visitor 68 */ 69 public function accept($visitor) 70 { 71 $this->_conditionalPrimary->accept($visitor); 72 $visitor->visitConditionalFactor($this); 73 } 74 63 64 75 65 /* Getters */ 76 77 66 public function getConditionalPrimary() 78 67 { -
trunk/lib/Doctrine/Query/Production/ConditionalPrimary.php
r4523 r4785 99 99 return false; 100 100 } 101 102 public function accept($visitor) 101 102 103 /* Getters */ 104 public function getConditionalExpression() 103 105 { 104 $this->_conditionalExpression->accept($visitor); 105 $visitor->visitConditionalPrimary($this); 106 return $this->_conditionalExpression; 106 107 } 107 108 } -
trunk/lib/Doctrine/Query/Production/ConditionalTerm.php
r4523 r4785 70 70 return $value->buildSql(); 71 71 } 72 73 /** 74 * Visitor support 75 * 76 * @param object $visitor 77 */ 78 public function accept($visitor) 79 { 80 foreach ($this->_conditionalFactors as $factor) { 81 $factor->accept($visitor); 82 } 83 $visitor->visitConditionalTerm($this); 84 } 85 72 73 86 74 /* Getters */ 87 88 75 public function getConditionalFactors() 89 76 { -
trunk/lib/Doctrine/Query/Production/ExistsExpression.php
r4523 r4785 52 52 return 'EXISTS (' . $this->_subselect->buildSql() . ')'; 53 53 } 54 55 /** 56 * Visitor support 57 * 58 * @param object $visitor 59 */ 60 public function accept($visitor) 61 { 62 $this->_subselect->accept($visitor); 63 $visitor->visitExistsExpression($this); 64 } 65 54 55 66 56 /* Getters */ 67 68 57 public function getSubselect() 69 58 { -
trunk/lib/Doctrine/Query/Production/Expression.php
r4523 r4785 87 87 return (is_string($value) ? $value : $value->buildSql()); 88 88 } 89 90 /** 91 * Visitor support 92 * 93 * @param object $visitor 94 */ 95 public function accept($visitor) 96 { 97 foreach ($this->_terms as $term) { 98 $term->accept($visitor); 99 } 100 $visitor->visitExpression($this); 101 } 102 89 90 103 91 /* Getters */ 104 105 92 public function getTerms() 106 93 { -
trunk/lib/Doctrine/Query/Production/FieldIdentificationVariable.php
r4523 r4785 25 25 * @package Doctrine 26 26 * @subpackage Query 27 * @author Guilherme Blanco <guilhermeblanco@hotmail.com> 27 28 * @author Janne Vanhala <jpvanhal@cc.hut.fi> 28 29 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL … … 75 76 . Doctrine_Query_Production::SQLALIAS_SEPARATOR . $idx; 76 77 } 77 78 /** 79 * Visitor support 80 * 81 * @param object $visitor 82 */ 83 public function accept($visitor) 84 { 85 $visitor->visitFieldIdentificationVariable($this); 86 } 87 78 79 88 80 /* Getters */ 89 90 81 public function getFieldAlias() 91 82 { 92 83 return $this->_fieldAlias; 93 84 } 94 85 86 95 87 public function getColumnAlias() 96 88 { -
trunk/lib/Doctrine/Query/Production/FromClause.php
r4523 r4785 72 72 return $value->buildSql(); 73 73 } 74 75 /**