[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/classes/ -> ezdiscountsubrulevalue.php (source)

   1  <?php
   2  //
   3  // Definition of eZDiscountSubRule class
   4  //
   5  // Created on: <27-Nov-2002 13:05:59 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 ezdiscountrule.php
  30  */
  31  
  32  /*!
  33    \class eZDiscountSubRuleValue ezdiscountsubrule.php
  34    \brief The class eZDiscountSubRuleValue does
  35  
  36  */
  37  include_once ( "kernel/classes/ezpersistentobject.php" );
  38  class eZDiscountSubRuleValue extends eZPersistentObject
  39  {
  40      /*!
  41       Constructor
  42      */
  43      function eZDiscountSubRuleValue( $row )
  44      {
  45          $this->eZPersistentObject( $row );
  46      }
  47  
  48      function definition()
  49      {
  50          return array( "fields" => array( "discountsubrule_id" => array( 'name' => "DiscountSubRuleID",
  51                                                                          'datatype' => 'integer',
  52                                                                          'default' => 0,
  53                                                                          'required' => true,
  54                                                                          'foreign_class' => 'eZDiscountSubRule',
  55                                                                          'foreign_attribute' => 'id',
  56                                                                          'multiplicity' => '1..*' ),
  57                                           "value" => array( 'name' => "Value",
  58                                                             'datatype' => 'integer',
  59                                                             'default' => 0,
  60                                                             'required' => true ),
  61                                           "issection" => array( 'name' => "IsSection",
  62                                                                 'datatype' => 'integer',
  63                                                                 'default' => 0,
  64                                                                 'required' => true ) ),
  65                        "keys" => array( "discountsubrule_id", "value", "issection" ),
  66                        "increment_key" => "discountsubrule_id",
  67                        "class_name" => "eZDiscountSubRuleValue",
  68                        "name" => "ezdiscountsubrule_value" );
  69      }
  70  
  71      function fetchBySubRuleID( $discountSubRuleID, $isSection = 0, $asObject = true )
  72      {
  73          return eZPersistentObject::fetchObjectList( eZDiscountSubRuleValue::definition(),
  74                                                      null,
  75                                                      array( "discountsubrule_id" => $discountSubRuleID,
  76                                                             "issection" => $isSection ),
  77                                                      null,
  78                                                      null,
  79                                                      $asObject );
  80      }
  81  
  82      /*!
  83       \note Transaction unsafe. If you call several transaction unsafe methods you must enclose
  84       the calls within a db transaction; thus within db->begin and db->commit.
  85       */
  86      function remove( $discountSubRuleID, $value, $isSection )
  87      {
  88          eZPersistentObject::removeObject( eZDiscountSubRuleValue::definition(),
  89                                             array( "discountsubrule_id" =>$discountSubRuleID,
  90                                                    "value" => $value,
  91                                                    "issection" => $isSection ) );
  92      }
  93  
  94      function &fetchList( $asObject = true )
  95      {
  96          $objectList = eZPersistentObject::fetchObjectList( eZDiscountSubRuleValue::definition(),
  97                                                              null, null, null, null,
  98                                                              $asObject );
  99          return $objectList;
 100      }
 101  
 102      function create( $discountSubRuleID, $value, $isSection = false )
 103      {
 104          $row = array(
 105              "discountsubrule_id" => $discountSubRuleID,
 106              "value" => $value,
 107              "issection" => $isSection );
 108          return new eZDiscountSubRuleValue( $row );
 109      }
 110  
 111      /*!
 112       \note Transaction unsafe. If you call several transaction unsafe methods you must enclose
 113       the calls within a db transaction; thus within db->begin and db->commit.
 114       */
 115      function removeBySubRuleID ( $discountSubRuleID )
 116      {
 117          eZPersistentObject::removeObject( eZDiscountSubRuleValue::definition(),
 118                                            array( "discountsubrule_id" => $discountSubRuleID ) );
 119      }
 120  }
 121  ?>


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