[ Index ]
 

Code source de Symfony 1.0.0

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

title

Body

[fermer]

/lib/vendor/phing/types/ -> Parameter.php (source)

   1  <?php
   2  /*
   3   *  $Id: Parameter.php 3076 2006-12-18 08:52:12Z fabien $
   4   *
   5   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   6   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   7   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   8   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   9   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16   *
  17   * This software consists of voluntary contributions made by many individuals
  18   * and is licensed under the LGPL. For more information please see
  19   * <http://phing.info>.
  20  */
  21  
  22  include_once 'phing/types/DataType.php';
  23  
  24  /*
  25   * A parameter is composed of a name, type and value. Nested
  26   * Parameters are also possible, but the using task/type has
  27   * to support them
  28   *
  29   * @author    Manuel Holtgrewe
  30   * @author    <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
  31   * @package   phing.types
  32  */
  33  class Parameter extends DataType {
  34  
  35      /** Parameter name */
  36      protected $name;
  37      
  38      /** Paramter type */
  39      protected $type;
  40      
  41      /** Parameter value */
  42      protected $value;
  43      
  44      /** Nested parameters */
  45      protected $parameters = array();
  46  
  47      function setName($name) {
  48          $this->name = (string) $name;
  49      }
  50      
  51      function setType($type) {
  52          $this->type = (string) $type;
  53      }
  54  
  55      /**
  56       * Sets value to dynamic register slot.
  57       * @param RegisterSlot $value
  58       */
  59      public function setListeningValue(RegisterSlot $value) {
  60          $this->value = $value;
  61      }
  62      
  63      function setValue($value) {
  64          $this->value = (string) $value;
  65      }
  66  
  67      function getName() {
  68          return $this->name;
  69      }
  70  
  71      function getType() {
  72          return $this->type;
  73      }
  74  
  75      function getValue() {
  76          if ($this->value instanceof RegisterSlot) {
  77              return $this->value->getValue();
  78          } else {
  79              return $this->value;
  80          }
  81      }
  82      
  83      /**
  84       * @return Parameter
  85       */
  86      function createParam() {
  87          $num = array_push($this->parameters, new Parameter());
  88          return $this->parameters[$num-1];
  89      }
  90  
  91      /**
  92       * @return array Nested parameters.
  93       */
  94      function getParams() {
  95          return $this->parameters;
  96      }
  97  }
  98  
  99  ?>


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