[ 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/database/model/ -> IdMethodParameter.php (source)

   1  <?php
   2  
   3  /*
   4   *  $Id: IdMethodParameter.php 64 2005-05-13 02:43:56Z root $
   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/database/model/XMLElement.php';
  24  
  25  /**
  26   * Information related to an ID method.
  27   *
  28   * @author Hans Lellelid <hans@xmpl.org> (Propel)
  29   * @author John McNally <jmcnally@collab.net> (Torque)
  30   * @author Daniel Rall <dlr@collab.net> (Torque)
  31   * @version $Revision: 64 $
  32   * @package propel.engine.database.model
  33   */
  34  class IdMethodParameter extends XMLElement {
  35  
  36      private $name;
  37      private $value;
  38      private $parentTable;
  39  
  40     /**
  41       * Sets up the IdMethodParameter object based on the attributes that were passed to loadFromXML().
  42       * @see parent::loadFromXML()
  43       */
  44      protected function setupObject()
  45      {
  46          $this->name = $this->getAttribute("name");
  47          $this->value = $this->getAttribute("value");
  48      }
  49  
  50      /**
  51       * Get the parameter name
  52       */
  53      public function getName()
  54      {
  55          return $this->name;
  56      }
  57  
  58      /**
  59       * Set the parameter name
  60       */
  61      public function setName($name)
  62      {
  63          $this->name = $name;
  64      }
  65  
  66      /**
  67       * Get the parameter value
  68       */
  69      public function getValue()
  70      {
  71          return $this->value;
  72      }
  73  
  74      /**
  75       * Set the parameter value
  76       */
  77      public function setValue($value)
  78      {
  79          $this->value = $value;
  80      }
  81  
  82      /**
  83       * Set the parent Table of the id method
  84       */
  85      public function setTable(Table $parent)
  86      {
  87          $this->parentTable = $parent;
  88      }
  89  
  90      /**
  91       * Get the parent Table of the id method
  92       */
  93      public function getTable()
  94      {
  95          return $this->parentTable;
  96      }
  97  
  98      /**
  99       * Returns the Name of the table the id method is in
 100       */
 101      public function getTableName()
 102      {
 103          return $this->parentTable->getName();
 104      }
 105  
 106      /**
 107       * XML representation of the foreign key.
 108       */
 109      public function toString()
 110      {
 111          $result = " <id-method-parameter";
 112          
 113          if ($this->getName() !== null) {
 114              $result .= " name=\""
 115                    . $this->getName()
 116                    . '"';
 117          } 
 118          
 119          $result .= " value=\""
 120                . $this->getValue()
 121                .  "\">\n";
 122                
 123          return $result;
 124      }
 125  }


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