[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/lib/ezxml/classes/ -> ezschemaelement.php (source)

   1  <?php
   2  //
   3  // $Id$
   4  //
   5  // Definition of eZSchemaElement class
   6  //
   7  // Bård Farstad <bf@ez.no>
   8  // Created on: <13-Feb-2002 10:58:53 bf>
   9  //
  10  // SOFTWARE NAME: eZ publish
  11  // SOFTWARE RELEASE: 3.9.0
  12  // BUILD VERSION: 17785
  13  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  14  // SOFTWARE LICENSE: GNU General Public License v2.0
  15  // NOTICE: >
  16  //   This program is free software; you can redistribute it and/or
  17  //   modify it under the terms of version 2.0  of the GNU General
  18  //   Public License as published by the Free Software Foundation.
  19  //
  20  //   This program is distributed in the hope that it will be useful,
  21  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  22  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23  //   GNU General Public License for more details.
  24  //
  25  //   You should have received a copy of version 2.0 of the GNU General
  26  //   Public License along with this program; if not, write to the Free
  27  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  28  //   MA 02110-1301, USA.
  29  //
  30  //
  31  
  32  /*!
  33    \class eZSchemaElement ezschemaelement.php
  34    \ingroup eZXML
  35    \brief eZSchemaElement handles schema validation elements
  36  
  37  */
  38  
  39  class eZSchemaElement
  40  {
  41      /*!
  42        Constructs a new eZSchemaElement object.
  43      */
  44      function eZSchemaElement()
  45      {
  46      }
  47  
  48      /*!
  49        Sets the elment name
  50      */
  51      function setName( $name )
  52      {
  53          $this->Name = $name;
  54      }
  55  
  56      /*!
  57        Returns the name of the schema element.
  58      */
  59      function name()
  60      {
  61          return $this->Name;
  62      }
  63  
  64      /*!
  65        Sets the type of the element, can either be simpleType, complexType or reference.
  66      */
  67      function setType( $type )
  68      {
  69          if ( $type == "complexType" )
  70              $this->Type = "complexType";
  71          else if ( $type == "reference" )
  72              $this->Type = "reference";
  73          else
  74              $this->Type = "simpleType";
  75      }
  76  
  77      /*!
  78        Returns the schema element type.
  79      */
  80      function type()
  81      {
  82          return $this->Type;
  83      }
  84  
  85      /*!
  86        Sets the datatype of the element.
  87      */
  88      function setDataType( $type )
  89      {
  90          $this->DataType = $type;
  91      }
  92  
  93      /*!
  94        The data type for simple types. False if not set.
  95      */
  96      function dataType()
  97      {
  98          return $this->DataType;
  99      }
 100  
 101      /*!
 102        Returns true if the type is complex, false if it's a simpletpe.
 103      */
 104      function isComplex()
 105      {
 106          if ( $this->Type == "complexType" )
 107              return true;
 108          else
 109              return false;
 110      }
 111  
 112      /*!
 113        Returns true if the element is a reference.
 114      */
 115      function isReference()
 116      {
 117          if ( $this->Type == "reference" )
 118              return true;
 119          else
 120              return false;
 121      }
 122  
 123      /*!
 124        Returns true if the type is a simple type, false if it's a complex type.
 125      */
 126      function isSimple()
 127      {
 128          if ( $this->Type == "simpleType" )
 129              return true;
 130          else
 131              return false;
 132      }
 133  
 134      /*!
 135        Sets the minum number of occurances for this element
 136      */
 137      function setMinOccurs( $value )
 138      {
 139          $this->MinOccurs = $value;
 140      }
 141  
 142      /*!
 143        Returns the minimum number of occurances of this element.
 144      */
 145      function minOccurs()
 146      {
 147          return $this->MinOccurs;
 148      }
 149  
 150      /*!
 151        Sets the maximum number of occurances for this element
 152      */
 153      function setMaxOccurs( $value )
 154      {
 155          $this->MaxOccurs = $value;
 156      }
 157  
 158      /*!
 159        Returns the maximum number of occurances of this element.
 160      */
 161      function maxOccurs()
 162      {
 163          return $this->MaxOccurs;
 164      }
 165  
 166      /*!
 167        Returns the children nodes for this schema element.
 168      */
 169      function children()
 170      {
 171          return $this->Children;
 172      }
 173  
 174      /*!
 175        Sets the reference identifier.
 176      */
 177      function setReference( $value )
 178      {
 179          $this->Reference = $value;
 180          $this->Type = "reference";
 181      }
 182  
 183      /*!
 184        Sets the parent element
 185      */
 186      function setParent( $element )
 187      {
 188          $this->ParentElement = $element;
 189      }
 190  
 191      /*!
 192        Returns the parent element. False
 193      */
 194      function parentElement()
 195      {
 196          return $this->ParentElement;
 197      }
 198  
 199      /*!
 200        Sets the next element
 201      */
 202      function setNext( $element )
 203      {
 204          $this->NextElement = $element;
 205      }
 206  
 207      /*!
 208        Returns the next element. False
 209      */
 210      function nextElement()
 211      {
 212          return $this->NextElement;
 213      }
 214  
 215      /// Reference to element
 216      var $Reference = false;
 217  
 218      /// The name of the element
 219      var $Name = "";
 220  
 221      /// The minimum number of occurances of the element
 222      var $MinOccurs = 1;
 223  
 224      /// The maximum number of occurances of the element
 225      var $MaxOccurs = 1;
 226  
 227      /// The schema type
 228      var $Type = "simpleType";
 229  
 230      /// The next element in the schema
 231      var $NextElement = false;
 232  
 233      /// The datatype of the element
 234      var $DataType = false;
 235  
 236      /// The parent element
 237      var $ParentElement = false;
 238  
 239      /// The sub elements of this element
 240      var $Children = array();
 241  }
 242  
 243  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7