[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/ -> PHP5InterfaceBuilder.php (source)

   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 interface for user object model (OM).
  27   * 
  28   * This class produces the empty stub interface when the interface="" attribute is used
  29   * in the the schema xml.
  30   * 
  31   * This class replaces the Interface.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 PHP5InterfaceBuilder 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 ClassTools::classname($this->getInterface());
  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      } // addIncludes()
  56      
  57      /**
  58       * Adds class phpdoc comment and openning of class.
  59       * @param string &$script The script will be modified in this method.
  60       */
  61  	protected function addClassOpen(&$script)
  62      {
  63          
  64          $table = $this->getTable();
  65          $tableName = $table->getName();
  66          $tableDesc = $table->getDescription();
  67          
  68          $baseClassname = $this->getObjectBuilder()->getClassname();
  69          
  70          $script .= "
  71  /**
  72   * This is an interface that should be filled with the public api of the $tableName objects.  
  73   *
  74   * $tableDesc
  75   *";
  76          if ($this->getBuildProperty('addTimeStamp')) {
  77              $now = strftime('%c');
  78              $script .= "
  79   * This class was autogenerated by Propel on:
  80   *
  81   * $now
  82   *";
  83          }
  84          $script .= "
  85   * You should add additional method declarations to this interface to meet the
  86   * application requirements.  This interface will only be generated as
  87   * long as it does not already exist in the output directory.
  88   *
  89   * @package ".$this->getPackage()."
  90   */    
  91  interface ".$this->getClassname()." {
  92  ";
  93      }
  94      
  95      /**
  96       * Specifies the methods that are added as part of the stub object class.
  97       * 
  98       * By default there are no methods for the empty stub classes; override this method
  99       * if you want to change that behavior.
 100       * 
 101       * @see ObjectBuilder::addClassBody()
 102       */
 103  	protected function addClassBody(&$script)
 104      {
 105          // there is no class body
 106      }
 107      
 108      /**
 109       * Closes class.
 110       * @param string &$script The script will be modified in this method.
 111       */    
 112  	protected function addClassClose(&$script)
 113      {
 114          $script .= "
 115  } // " . $this->getClassname() . "
 116  ";
 117      }
 118      
 119  } // PHP5ExtensionObjectBuilder


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7