[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 3 /* 4 * $Id: PHP5BasicObjectBuilder.php 120 2005-06-17 02:18:41Z hans $ 5 * 6 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17 * 18 * This software consists of voluntary contributions made by many individuals 19 * and is licensed under the LGPL. For more information please see 20 * <http://propel.phpdb.org>. 21 */ 22 23 require_once 'propel/engine/builder/om/ObjectBuilder.php'; 24 25 /** 26 * Generates the empty PHP5 stub node object class for user object model (OM). 27 * 28 * This class produces the empty stub class that can be customized with application 29 * business logic, custom behavior, etc. 30 * 31 * This class replaces the ExtensionNode.tpl, with the intent of being easier for users 32 * to customize (through extending & overriding). 33 * 34 * @author Hans Lellelid <hans@xmpl.org> 35 * @package propel.engine.builder.om.php5 36 */ 37 class PHP5ExtensionNodeBuilder extends ObjectBuilder { 38 39 /** 40 * Returns the name of the current class being built. 41 * @return string 42 */ 43 public function getClassname() 44 { 45 return $this->getTable()->getPhpName() . 'Node'; 46 } 47 48 /** 49 * Adds the include() statements for files that this class depends on or utilizes. 50 * @param string &$script The script will be modified in this method. 51 */ 52 protected function addIncludes(&$script) 53 { 54 55 $script .= " 56 require_once '".$this->getNodeBuilder()->getClassFilePath()."'; 57 "; 58 59 } // addIncludes() 60 61 /** 62 * Adds class phpdoc comment and openning of class. 63 * @param string &$script The script will be modified in this method. 64 */ 65 protected function addClassOpen(&$script) 66 { 67 68 $table = $this->getTable(); 69 $tableName = $table->getName(); 70 $tableDesc = $table->getDescription(); 71 72 $baseClassname = $this->getNodeBuilder()->getClassname(); 73 74 $script .= " 75 76 /** 77 * Skeleton subclass for representing a node from the '$tableName' table. 78 * 79 * $tableDesc 80 *"; 81 if ($this->getBuildProperty('addTimeStamp')) { 82 $now = strftime('%c'); 83 $script .= " 84 * This class was autogenerated by Propel on: 85 * 86 * $now 87 *"; 88 } 89 $script .= " 90 * You should add additional methods to this class to meet the 91 * application requirements. This class will only be generated as 92 * long as it does not already exist in the output directory. 93 * 94 * @package ".$this->getPackage()." 95 */ 96 class ".$this->getClassname()." extends $baseClassname { 97 "; 98 } 99 100 /** 101 * Specifies the methods that are added as part of the stub object class. 102 * 103 * By default there are no methods for the empty stub classes; override this method 104 * if you want to change that behavior. 105 * 106 * @see ObjectBuilder::addClassBody() 107 */ 108 protected function addClassBody(&$script) 109 { 110 // there is no class body 111 } 112 113 /** 114 * Closes class. 115 * @param string &$script The script will be modified in this method. 116 */ 117 protected function addClassClose(&$script) 118 { 119 $script .= " 120 } // " . $this->getClassname() . " 121 "; 122 } 123 124 } // PHP5ExtensionObjectBuilder
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |