[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/classes/datatypes/ezenum/ -> ezenumobjectvalue.php (source)

   1  <?php
   2  //
   3  // Definition of eZEnum class
   4  //
   5  // Created on: <24-ßÂ-2002 16:07:05 wy>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezenumobjectvalue.php
  30  */
  31  
  32  include_once ( "lib/ezdb/classes/ezdb.php" );
  33  include_once ( "kernel/classes/ezpersistentobject.php" );
  34  include_once ( "kernel/classes/ezcontentclassattribute.php" );
  35  
  36  /*!
  37    \class eZEnumObjectValue ezenumobjectvalue.php
  38    \brief The class eZEnumObjectValue stores chosen enum values of an object attribute
  39  
  40  */
  41  
  42  class eZEnumObjectValue extends eZPersistentObject
  43  {
  44      /*!
  45       Constructor
  46      */
  47      function eZEnumObjectValue( $row )
  48      {
  49          $this->eZPersistentObject( $row );
  50      }
  51  
  52      function definition()
  53      {
  54          return array( "fields" => array( "contentobject_attribute_id" => array( 'name' => "ContentObjectAttributeID",
  55                                                                                  'datatype' => 'integer',
  56                                                                                  'default' => 0,
  57                                                                                  'required' => true,
  58                                                                                  'foreign_class' => 'eZContentObjectAttribute',
  59                                                                                  'foreign_attribute' => 'id',
  60                                                                                  'multiplicity' => '1..*' ),
  61                                           "contentobject_attribute_version" => array( 'name' => "ContentObjectAttributeVersion",
  62                                                                                       'datatype' => 'integer',
  63                                                                                       'default' => 0,
  64                                                                                       'required' => true,
  65                                                                                       'short_name' => 'contentobject_attr_version' ),
  66                                           "enumid" => array( 'name' => "EnumID",
  67                                                              'datatype' => 'integer',
  68                                                              'default' => 0,
  69                                                              'required' => true ),
  70                                           "enumelement" => array( 'name' => "EnumElement",
  71                                                                   'datatype' => 'string',
  72                                                                   'default' => '',
  73                                                                   'required' => true ),
  74                                           "enumvalue" => array( 'name' => "EnumValue",
  75                                                                 'datatype' => 'string',
  76                                                                 'default' => '',
  77                                                                 'required' => true ) ),
  78                        "keys" => array( "contentobject_attribute_id", "contentobject_attribute_version", "enumid" ),
  79                        "sort" => array( "contentobject_attribute_id" => "asc" ),
  80                        "class_name" => "eZEnumObjectValue",
  81                        "name" => "ezenumobjectvalue" );
  82      }
  83  
  84      function create( $contentObjectAttributeID, $contentObjectAttributeVersion, $enumID, $enumElement, $enumValue )
  85      {
  86          $row = array( "contentobject_attribute_id" => $contentObjectAttributeID,
  87                        "contentobject_attribute_version" => $contentObjectAttributeVersion,
  88                        "enumid" => $enumID,
  89                        "enumelement" =>  $enumElement,
  90                        "enumvalue" => $enumValue );
  91          return new eZEnumObjectValue( $row );
  92      }
  93  
  94      function removeAllElements( $contentObjectAttributeID, $contentObjectAttributeVersion )
  95      {
  96          if( $contentObjectAttributeVersion == null )
  97          {
  98              eZPersistentObject::removeObject( eZEnumObjectValue::definition(),
  99                                                array( "contentobject_attribute_id" => $contentObjectAttributeID ) );
 100          }
 101          else
 102          {
 103              eZPersistentObject::removeObject( eZEnumObjectValue::definition(),
 104                                                array( "contentobject_attribute_id" => $contentObjectAttributeID,
 105                                                       "contentobject_attribute_version" => $contentObjectAttributeVersion ) );
 106          }
 107      }
 108  
 109      function remove( $contentObjectAttributeID, $contentObjectAttributeVersion, $enumid )
 110      {
 111          eZPersistentObject::removeObject( eZEnumObjectValue::definition(),
 112                                            array( "enumid" => $enumid,
 113                                                   "contentobject_attribute_id" => $contentObjectAttributeID,
 114                                                   "contentobject_attribute_version" => $contentObjectAttributeVersion ) );
 115      }
 116  
 117      function fetch( $contentObjectAttributeID, $contentObjectAttributeVersion, $enumid, $asObject = true )
 118      {
 119          return eZPersistentObject::fetchObject( eZEnumObjectValue::definition(),
 120                                                  null,
 121                                                  array(  "contentobject_attribute_id" => $contentObjectAttributeID,
 122                                                          "contentobject_attribute_version" => $contentObjectAttributeVersion,
 123                                                          "enumid" => $enumid ),
 124                                                  $asObject );
 125      }
 126  
 127      function fetchAllElements( $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject = true )
 128      {
 129          return eZPersistentObject::fetchObjectList( eZEnumObjectValue::definition(),
 130                                                      null,
 131                                                      array( "contentobject_attribute_id" => $contentObjectAttributeID,
 132                                                             "contentobject_attribute_version" => $contentObjectAttributeVersion ),
 133                                                      null,
 134                                                      null,
 135                                                      $asObject );
 136      }
 137  
 138      var $ContentObjectAttributeID;
 139      var $ContentObjectAttributeVersion;
 140      var $EnumID;
 141      var $EnumElement;
 142      var $EnumValue;
 143  }
 144  
 145  ?>


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