Changeset 1082 for trunk/generator
- Timestamp:
- 09/17/08 14:11:31 (3 months ago)
- Files:
-
- trunk (modified) (1 prop)
- trunk/generator/classes/propel/engine/builder/om/OMBuilder.php (modified) (6 diffs)
- trunk/generator/classes/propel/engine/builder/om/ObjectBuilder.php (modified) (1 diff)
- trunk/generator/classes/propel/engine/builder/om/PeerBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionNodeBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionNodePeerBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionObjectBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionPeerBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5InterfaceBuilder.php (modified) (2 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5MapBuilderBuilder.php (modified) (4 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5MultiExtendObjectBuilder.php (modified) (3 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetBuilder.php (modified) (34 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetPeerBuilder.php (modified) (58 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5NodeBuilder.php (modified) (27 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5NodePeerBuilder.php (modified) (21 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php (modified) (32 diffs)
- trunk/generator/classes/propel/engine/builder/om/php5/PHP5PeerBuilder.php (modified) (88 diffs)
- trunk/generator/classes/propel/phing/PropelConvertConfTask.php (modified) (4 diffs)
- trunk/generator/default.properties (modified) (1 diff)
- trunk/generator/projects/bookstore/runtime-conf.xml (modified) (1 diff)
- trunk/generator/test/classes/bookstore/BookstoreDataPopulator.php (modified) (17 diffs)
- trunk/generator/test/classes/bookstore/BookstoreTestBase.php (modified) (2 diffs)
- trunk/generator/test/classes/cms/CmsDataPopulator.php (modified) (3 diffs)
- trunk/generator/test/classes/propel/CharacterEncodingTest.php (modified) (6 diffs)
- trunk/generator/test/classes/propel/FieldnameRelatedTest.php (modified) (26 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetObjectTest.php (modified) (11 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetPeerTest.php (modified) (15 diffs)
- trunk/generator/test/classes/propel/GeneratedNestedSetTest.php (modified) (5 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectLobTest.php (modified) (6 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectRelTest.php (modified) (16 diffs)
- trunk/generator/test/classes/propel/GeneratedObjectTest.php (modified) (53 diffs)
- trunk/generator/test/classes/propel/GeneratedPeerTest.php (modified) (52 diffs)
- trunk/generator/test/classes/propel/Ticket520Test.php (modified) (11 diffs)
- trunk/generator/test/classes/propel/util/BasePeerTest.php (modified) (5 diffs)
- trunk/generator/test/classes/propel/util/PropelPDOTest.php (modified) (3 diffs)
- trunk/generator/test/classes/propel/validator/ValidatorTest.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk
- Property svn:ignore set to
.project
.cache
.settings
- Property svn:ignore set to
trunk/generator/classes/propel/engine/builder/om/OMBuilder.php
r1068 r1082 31 31 * 32 32 * @author Hans Lellelid <hans@xmpl.org> 33 * @author Tony Bibbs <tony@tonybibbs.com> 33 34 * @package propel.engine.builder.om 35 * @todo Explore if the methods listed in build() shouldn't be defined formally in an 36 * interface 34 37 */ 35 38 abstract class OMBuilder extends DataModelBuilder { 36 39 const NAMESPACE_GLOBAL = 1; 40 const NAMESPACE_OM = 2; 41 const NAMESPACE_PEER = 3; 42 const NAMESPACE_MAP = 4; 43 44 /** 45 * Generated code needs to behave differently if we are using 5.3+ namespaces 46 * 47 * NOTE: this works gracefully if user has disabled namespaces in their properties file. 48 * 49 * @access protected 50 * @return string Either empty string when we aren't using namepaces or :: if we are. 51 * 52 */ 53 protected function getNamespaceQualifier($nameSpaceToGet = self::NAMESPACE_GLOBAL) 54 { 55 if ($this->getBuildProperty('namespaceEnabled') <> 1) return ''; 56 switch ($nameSpaceToGet) { 57 case self::NAMESPACE_GLOBAL: 58 return '::'; 59 case self::NAMESPACE_MAP: 60 return $this->getBuildProperty('namespaceMap') . '::'; 61 case self::NAMESPACE_OM: 62 return $this->getBuildProperty('namespaceOm') . '::'; 63 case self::NAMESPACE_PEER: 64 return $this->getBuildProperty('namespacePeer') . '::'; 65 default: 66 throw new Exception('Invalid namespace given'); 67 } 68 } 69 70 /** 71 * Gets the base peer classname with fully qualified namespace. 72 * 73 * @access protected 74 * @return string fully qualified classname. 75 * 76 */ 77 protected function getNamespaceQualifiedBasePeer() 78 { 79 if ($this->getBuildProperty('namespaceEnabled') <> 1) return $this->basePeerClassname; 80 if ($this->basePeerClassname == 'BasePeer') return '::BasePeer'; 81 return $this->getNamspaceQualifier(self::NAMESPACE_PEER) . $this->basePeerClassname; 82 } 83 84 /** 85 * Takes a class name and prepends the namespace. 86 * 87 * NOTE: this is probably not fail proof 88 * 89 * @access protected 90 * @param $clsName string Name of class to prepend namespace too. 91 * @return string Namespaced class name. 92 * 93 */ 94 protected function getNamespacedClassName($clsName) 95 { 96 $newClassName = ''; 97 98 // Hardest one to find is the OM so use it by default 99 $newClassName = $this->getNamespaceQualifier(self::NAMESPACE_OM) . $clsName; 100 101 // Now adjust if needed. 102 if ($clsName == 'BasePeer') $newClassName = $this->getNamespaceQualifier(self::NAMESPACE_GLOBAL) . $clsName; 103 if (strstr($clsName,'Peer')) $newClassName = $this->getNamespaceQualifier(self::NAMESPACE_PEER) . $clsName; 104 if (strstr($clsName,'MapBuilder')) $newClassName = $this->getNamespaceQualifier(self::NAMESPACE_MAP) . $clsName; 105 106 return $newClassName; 107 } 108 37 109 /** 38 110 * Builds the PHP source for current class and returns it as a string. … … 50 122 51 123 $script = "<" . "?php\n"; // intentional concatenation 124 $this->addNamespace($script); 52 125 $this->addIncludes($script); 53 126 $this->addClassOpen($script); … … 89 162 90 163 /** 91 * Returns the prefixed clasname that is being built by the current class. 164 * Returns the prefixed classname that is being built by the current class. 165 * 166 * @param $includeNamespace boolean If true we will include the namespace prefix with the peer 167 * classname *if* namespace support was enabled in the properties file. 92 168 * @return string 93 169 * @see DataModelBuilder#prefixClassname() 94 170 */ 95 public function getClassname() 96 { 97 return $this->prefixClassname($this->getUnprefixedClassname()); 98 } 171 public function getClassname($includeNamespace = true) 172 { 173 if ($this->getBuildProperty('namespaceEnabled') <> 1 174 OR !$includeNamespace) { 175 return $this->prefixClassname($this->getUnprefixedClassname()); 176 } 177 return $this->getNamespacedClassName($this->prefixClassname($this->getUnprefixedClassname())); 178 } 179 99 180 /** 100 181 * Gets the dot-path representation of current class being built. … … 117 198 public function getClassFilePath() 118 199 { 119 return ClassTools::getFilePath($this->getPackage(), $this->getClassname( ));200 return ClassTools::getFilePath($this->getPackage(), $this->getClassname(false)); 120 201 } 121 202 … … 147 228 * This is the classname that is used whenever object or peer classes want 148 229 * to invoke methods of the peer classes. 230 * @param $includeNamespace boolean If true we will include the namespace prefix with the peer 231 * classname *if* namespace support was enabled in the properties file. 149 232 * @return string (e.g. 'MyPeer') 150 233 * @see StubPeerBuilder::getClassname() 151 234 */ 152 public function getPeerClassname() { 153 return $this->getStubPeerBuilder()->getClassname(); 235 public function getPeerClassname($includeNamespace = true) { 236 237 if ($this->getBuildProperty('namespaceEnabled') <> 1 238 OR !$includeNamespace) { 239 return $this->getStubPeerBuilder()->getClassname(false); 240 } 241 return $this->getStubPeerBuilder()->getClassname(); 154 242 } 155 243 … … 158 246 * This is the classname that is used whenever object or peer classes want 159 247 * to invoke methods of the object classes. 248 * 249 * @param $includeNamespace boolean If true we will include the namespace prefix with the peer 250 * classname *if* namespace support was enabled in the properties file. 160 251 * @return string (e.g. 'My') 161 252 * @see StubPeerBuilder::getClassname() 162 253 */ 163 public function getObjectClassname( ) {164 return $this->getStubObjectBuilder()->getClassname( );254 public function getObjectClassname($includeNamespace = true) { 255 return $this->getStubObjectBuilder()->getClassname($includeNamespace); 165 256 } 166 257 trunk/generator/classes/propel/engine/builder/om/ObjectBuilder.php
r833 r1082 35 35 */ 36 36 abstract class ObjectBuilder extends OMBuilder { 37 38 37 /** 39 38 * Constructs a new PeerBuilder subclass. trunk/generator/classes/propel/engine/builder/om/PeerBuilder.php
r1068 r1082 32 32 * 33 33 * @author Hans Lellelid <hans@xmpl.org> 34 * @author Tony Bibbs <tony@tonybibbs.com> 34 35 * @package propel.engine.builder.om 35 36 */ 36 37 abstract class PeerBuilder extends OMBuilder { 37 38 38 protected $basePeerClass; 39 39 protected $basePeerClassname; … … 50 50 } 51 51 } 52 52 53 /** 54 * Adds the namespace declaration if configured to do so. 55 * @param string &$script The script will be modified in this method. 56 */ 57 protected function addNamespace(&$script) 58 { 59 // If not enabled bail. 60 //print_r($this->getGeneratorConfig()); exit; 61 //print $this->getBuildProperty('namespaceEnabled'); die("\n\ndone\n\n"); 62 if ($this->getBuildProperty('namespaceEnabled') <> 1) return; 63 64 $namespaceToUse = $this->getBuildProperty('namespacePeer'); 65 $script .= "\nnamespace $namespaceToUse;\n"; 66 } 67 53 68 /** 54 69 * Adds the addSelectColumns(), doCount(), etc. methods. trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionNodeBuilder.php
r521 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com> 35 36 * @package propel.engine.builder.om.php5 36 37 */ … … 92 93 * @package ".$this->getPackage()." 93 94 */ 94 class ".$this->getClassname( )." extends $baseClassname {95 class ".$this->getClassname(false)." extends $baseClassname { 95 96 "; 96 97 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionNodePeerBuilder.php
r521 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com 35 36 * @package propel.engine.builder.om.php5 36 37 */ … … 92 93 * @package ".$this->getPackage()." 93 94 */ 94 class ".$this->getClassname( )." extends $baseClassname {95 class ".$this->getClassname(false)." extends $baseClassname { 95 96 "; 96 97 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionObjectBuilder.php
r1081 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com> 35 36 * @package propel.engine.builder.om.php5 36 37 */ 37 38 class PHP5ExtensionObjectBuilder extends ObjectBuilder { 38 39 40 /** 41 * Adds the namespace declaration if configured to do so. 42 * @param string &$script The script will be modified in this method. 43 */ 44 public function addNamespace(&$script) 45 { 46 // If not enabled bail. 47 if ($this->getBuildProperty('namespaceEnabled') <> 1) return; 48 49 $namespaceToUse = $this->getBuildProperty('namespaceOm'); 50 $script .= "\nnamespace $namespaceToUse;\n"; 51 } 52 39 53 /** 40 54 * Returns the name of the current class being built. … … 119 133 * @package ".$this->getPackage()." 120 134 */ 121 ".($table->isAbstract() ? "abstract " : "")."class ".$this->getClassname( )." extends $baseClassname {135 ".($table->isAbstract() ? "abstract " : "")."class ".$this->getClassname(false)." extends $baseClassname { 122 136 "; 123 137 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5ExtensionPeerBuilder.php
r521 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com> 35 36 * @package propel.engine.builder.om.php5 36 37 */ … … 113 114 * @package ".$this->getPackage()." 114 115 */ 115 class ".$this->getClassname( )." extends $baseClassname {116 class ".$this->getClassname(false)." extends $baseClassname { 116 117 "; 117 118 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5InterfaceBuilder.php
r521 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com> 35 36 * @package propel.engine.builder.om.php5 36 37 */ … … 89 90 * @package ".$this->getPackage()." 90 91 */ 91 interface ".$this->getClassname( )." {92 interface ".$this->getClassname(false)." { 92 93 "; 93 94 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5MapBuilderBuilder.php
r1068 r1082 30 30 * 31 31 * @author Hans Lellelid <hans@xmpl.org> 32 * @author Tony Bibbs <tony@tonybibbs.com> 32 33 * @package propel.engine.builder.om.php5 33 34 */ 34 class PHP5MapBuilderBuilder extends OMBuilder { 35 35 class PHP5MapBuilderBuilder extends OMBuilder { 36 36 /** 37 37 * Gets the package for the map builder classes. … … 43 43 } 44 44 45 /** 46 * Adds the namespace declaration if configured to do so. 47 * @param string &$script The script will be modified in this method. 48 */ 49 public function addNamespace(&$script) 50 { 51 // If not enabled bail. 52 if ($this->getBuildProperty('namespaceEnabled') <> 1) return; 53 54 $namespaceToUse = $this->getBuildProperty('namespaceMap'); 55 $script .= "\nnamespace $namespaceToUse;\n"; 56 } 57 45 58 /** 46 59 * Returns the name of the current class being built. … … 90 103 * @package ".$this->getPackage()." 91 104 */ 92 class ".$this->getClassname( )." implementsMapBuilder {105 class ".$this->getClassname(false)." implements ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."MapBuilder { 93 106 "; 94 107 } … … 203 216 * 204 217 * @return void 205 * @throws PropelException218 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException 206 219 */ 207 220 public function doBuild() 208 221 { 209 \$this->dbMap = Propel::getDatabaseMap(".$this->getPeerClassname()."::DATABASE_NAME);222 \$this->dbMap = ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."Propel::getDatabaseMap(".$this->getPeerClassname()."::DATABASE_NAME); 210 223 211 224 \$tMap = \$this->dbMap->addTable(".$this->getPeerClassname()."::TABLE_NAME); trunk/generator/classes/propel/engine/builder/om/php5/PHP5MultiExtendObjectBuilder.php
r1068 r1082 33 33 * 34 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @author Tony Bibbs <tony@tonybibbs.com> 35 36 * @package propel.engine.builder.om.php5 36 37 */ … … 121 122 } // addIncludes() 122 123 124 /** 125 * Adds the namespace declaration if configured to do so. 126 * @param string &$script The script will be modified in this method. 127 */ 128 protected function addNamespace(&$script) 129 { 130 if ($this->getBuildProperty('namespaceEnabled') <> 1) return; 131 132 $namespaceToUse = $this->getBuildProperty('namespaceOm'); 133 $script .= "\nnamespace $namespaceToUse;\n"; 134 } 135 123 136 /** 124 137 * Adds class phpdoc comment and openning of class. … … 156 169 * @package ".$this->getPackage()." 157 170 */ 158 class ".$this->getClassname( )." extends ".$this->getParentClassname()." {171 class ".$this->getClassname(false)." extends ".$this->getParentClassname()." { 159 172 "; 160 173 } trunk/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetBuilder.php
r1068 r1082 1 1 <?php 2 2 3 /* 3 4 * $Id$ … … 29 30 * 30 31 * @author Heltem <heltem@o2php.com> 32 * @author Tony Bibbs <tony@tonybibbs.com> 31 33 * @package propel.engine.builder.om.php5 32 34 */ … … 42 44 } 43 45 46 /** 47 * Adds the namespace declaration if configured to do so. 48 * @param string &$script The script will be modified in this method. 49 */ 50 protected function addNamespace(&$script) 51 { 52 // If not enabled bail. 53 if ($this->getBuildProperty('namespaceEnabled') <> 1) return; 54 55 $namespaceToUse = $this->getBuildProperty('namespaceNest'); 56 $script .= "\nnamespace $namespaceToUse;\n"; 57 } 58 44 59 /** 45 60 * Returns the name of the current class being built. … … 90 105 * @package ".$this->getPackage()." 91 106 */ 92 abstract class ".$this->getClassname( )." extends ".$this->getObjectBuilder()->getClassname()." implementsNodeObject {107 abstract class ".$this->getClassname(false)." extends ".$this->getObjectBuilder()->getClassname()." implements ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject { 93 108 "; 94 109 } … … 259 274 * If object is saved without left/right values, set them as undefined (0) 260 275 * 261 * @param PropelPDO Connection to use.276 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 262 277 * @return void 263 * @throws PropelException264 */ 265 public function save( PropelPDO \$con = null)278 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException 279 */ 280 public function save(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 266 281 { 267 282 \$left = \$this->getLeftValue(); … … 284 299 * Removes this object and all descendants from datastore. 285 300 * 286 * @param PropelPDO Connection to use.301 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 287 302 * @return void 288 * @throws PropelException289 */ 290 public function delete( PropelPDO \$con = null)303 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException 304 */ 305 public function delete(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 291 306 { 292 307 // delete node first … … 308 323 * 309 324 * @return $objectClassName The current object (for fluent API support) 310 * @throws PropelException325 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException 311 326 */ 312 327 public function makeRoot() … … 325 340 * Gets the level if set, otherwise calculates this and returns it 326 341 * 327 * @param PropelPDO Connection to use.342 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 328 343 * @return int 329 344 */ 330 public function getLevel( PropelPDO \$con = null)345 public function getLevel(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 331 346 { 332 347 if (null === \$this->level) { … … 385 400 * @return $objectClassName The current object (for fluent API support) 386 401 */ 387 public function setParentNode( NodeObject \$parent = null)402 public function setParentNode(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$parent = null) 388 403 { 389 404 \$this->parentNode = (true === (\$this->hasParentNode = $peerClassname::isValid(\$parent))) ? \$parent : null; … … 404 419 * @return $objectClassName The current object (for fluent API support) 405 420 */ 406 public function setPrevSibling( NodeObject \$node = null)421 public function setPrevSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$node = null) 407 422 { 408 423 \$this->prevSibling = \$node; … … 424 439 * @return $objectClassName The current object (for fluent API support) 425 440 */ 426 public function setNextSibling( NodeObject \$node = null)441 public function setNextSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$node = null) 427 442 { 428 443 \$this->nextSibling = \$node; … … 440 455 * Get the path to the node in the tree 441 456 * 442 * @param PropelPDO Connection to use.457 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 443 458 * @return array 444 459 */ 445 public function getPath( PropelPDO \$con = null)460 public function getPath(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 446 461 { 447 462 return $peerClassname::getPath(\$this, \$con); … … 457 472 * Gets the number of children for the node (direct descendants) 458 473 * 459 * @param PropelPDO Connection to use.474 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 460 475 * @return int 461 476 */ 462 public function getNumberOfChildren( PropelPDO \$con = null)477 public function getNumberOfChildren(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 463 478 { 464 479 return $peerClassname::getNumberOfChildren(\$this, \$con); … … 474 489 * Gets the total number of descendants for the node 475 490 * 476 * @param PropelPDO Connection to use.491 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 477 492 * @return int 478 493 */ 479 public function getNumberOfDescendants( PropelPDO \$con = null)494 public function getNumberOfDescendants(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 480 495 { 481 496 return $peerClassname::getNumberOfDescendants(\$this, \$con); … … 491 506 * Gets the children for the node 492 507 * 493 * @param PropelPDO Connection to use.508 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 494 509 * @return array 495 510 */ 496 public function getChildren( PropelPDO \$con = null)511 public function getChildren(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 497 512 { 498 513 \$this->getLevel(); … … 514 529 * Gets the descendants for the node 515 530 * 516 * @param PropelPDO Connection to use.531 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO Connection to use. 517 532 * @return array 518 533 */ 519 public function getDescendants( PropelPDO \$con = null)534 public function getDescendants(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 520 535 { 521 536 \$this->getLevel(); … … 571 586 * @return bool 572 587 */ 573 public function isEqualTo( NodeObject \$node)588 public function isEqualTo(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$node) 574 589 { 575 590 return $peerClassname::isEqualTo(\$this, \$node); … … 585 600 * Tests if object has an ancestor 586 601 * 587 * @param PropelPDO \$con Connection to use.602 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 588 603 * @return bool 589 604 */ 590 public function hasParent( PropelPDO \$con = null)605 public function hasParent(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 591 606 { 592 607 if (null === \$this->hasParentNode) { … … 609 624 public function hasChildren() 610 625 { 611 return $peerClassname::hasChildren(\$this);626 return $peerClassname::hasChildren(\$this); 612 627 } 613 628 "; … … 621 636 * Determines if the node has previous sibling 622 637 * 623 * @param PropelPDO \$con Connection to use.638 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 624 639 * @return bool 625 640 */ 626 public function hasPrevSibling( PropelPDO \$con = null)641 public function hasPrevSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 627 642 { 628 643 if (null === \$this->hasPrevSibling) { … … 641 656 * Determines if the node has next sibling 642 657 * 643 * @param PropelPDO \$con Connection to use.658 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 644 659 * @return bool 645 660 */ 646 public function hasNextSibling( PropelPDO \$con = null)661 public function hasNextSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 647 662 { 648 663 if (null === \$this->hasNextSibling) { … … 661 676 * Gets ancestor for the given node if it exists 662 677 * 663 * @param PropelPDO \$con Connection to use.678 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 664 679 * @return mixed Propel object if exists else false 665 680 */ 666 public function retrieveParent( PropelPDO \$con = null)681 public function retrieveParent(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 667 682 { 668 683 if (null === \$this->hasParentNode) { … … 682 697 * Gets first child if it exists 683 698 * 684 * @param PropelPDO \$con Connection to use.699 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 685 700 * @return mixed Propel object if exists else false 686 701 */ 687 public function retrieveFirstChild( PropelPDO \$con = null)702 public function retrieveFirstChild(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 688 703 { 689 704 if (\$this->hasChildren(\$con)) { … … 706 721 * Gets last child if it exists 707 722 * 708 * @param PropelPDO \$con Connection to use.723 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 709 724 * @return mixed Propel object if exists else false 710 725 */ 711 public function retrieveLastChild( PropelPDO \$con = null)726 public function retrieveLastChild(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 712 727 { 713 728 if (\$this->hasChildren(\$con)) { … … 730 745 * Gets prev sibling for the given node if it exists 731 746 * 732 * @param PropelPDO \$con Connection to use.747 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 733 748 * @return mixed Propel object if exists else false 734 749 */ 735 public function retrievePrevSibling( PropelPDO \$con = null)750 public function retrievePrevSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 736 751 { 737 752 if (\$this->hasPrevSibling(\$con)) { … … 749 764 * Gets next sibling for the given node if it exists 750 765 * 751 * @param PropelPDO \$con Connection to use.766 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 752 767 * @return mixed Propel object if exists else false 753 768 */ 754 public function retrieveNextSibling( PropelPDO \$con = null)769 public function retrieveNextSibling(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 755 770 { 756 771 if (\$this->hasNextSibling(\$con)) { … … 771 786 * 772 787 * @param $objectClassName \$parent Propel object for destination node 773 * @param PropelPDO \$con Connection to use. 774 * @return $objectClassName The current object (for fluent API support) 775 * @throws PropelException - if this object already exists 776 */ 777 public function insertAsFirstChildOf(NodeObject \$parent, PropelPDO \$con = null) 788 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 789 * @return $objectClassName The current object (for fluent API support) 790 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException - if this object already exists 791 */ 792 public function insertAsFirstChildOf(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$parent, ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 793 { 794 if (!\$this->isNew()) 795 { 796 throw new ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException(\"$objectClassName must be new.\"); 797 } 798 $peerClassname::insertAsFirstChildOf(\$this, \$parent, \$con); 799 return \$this; 800 } 801 "; 802 } 803 804 protected function addInsertAsLastChildOf(&$script) 805 { 806 $objectClassName = $this->getStubObjectBuilder()->getClassname(); 807 $peerClassname = $this->getStubPeerBuilder()->getClassname(); 808 $script .= " 809 /** 810 * Inserts as last child of given destination node \$parent 811 * 812 * @param $objectClassName \$parent Propel object for destination node 813 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 814 * @return $objectClassName The current object (for fluent API support) 815 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException - if this object already exists 816 */ 817 public function insertAsLastChildOf(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$parent, ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con = null) 818 { 819 if (!\$this->isNew()) 820 { 821 throw new ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException(\"$objectClassName must be new.\"); 822 } 823 $peerClassname::insertAsLastChildOf(\$this, \$parent, \$con); 824 return \$this; 825 } 826 "; 827 } 828 829 protected function addInsertAsPrevSiblingOf(&$script) 830 { 831 $objectClassName = $this->getStubObjectBuilder()->getClassname(); 832 $peerClassname = $this->getStubPeerBuilder()->getClassname(); 833 $script .= " 834 /** 835 * Inserts \$node as previous sibling to given destination node \$dest 836 * 837 * @param $objectClassName \$dest Propel object for destination node 838 * @param ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelPDO \$con Connection to use. 839 * @return $objectClassName The current object (for fluent API support) 840 * @throws ".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."PropelException - if this object already exists 841 */ 842 public function insertAsPrevSiblingOf(".$this->getNamespaceQualifier(self::NAMESPACE_GLOBAL)."NodeObject \$dest, PropelPDO \$con = null) 778 843 { 779 844 if (!\$this->isNew()) … … 781 846 throw new PropelException(\"$objectClassName must be new.\"); 782 847 } 783 $peerClassname::insertAs FirstChildOf(\$this, \$parent, \$con);784 return \$this; 785 } 786 "; 787 } 788 789 protected function addInsertAs LastChildOf(&$script)790 { 791 $objectClassName = $this->getStubObjectBuilder()->getClassname(); 792 $peerClassname = $this->getStubPeerBuilder()->getClassname(); 793 $script .= " 794 /** 795 * Inserts as last child of given destination node \$parent796 * 797 * @param $objectClassName \$ parent Propel object for destination node798 * @param PropelPDO \$con Connection to use.799 * @return $objectClassName The current object (for fluent API support) 800 * @throws PropelException - if this object already exists801 */ 802 public function insertAs LastChildOf(NodeObject \$parent, PropelPDO \$con = null)848 $peerClassname::insertAsPrevSiblingOf(\$this, \$dest, \$con); 849 return \$this;  
