[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/classes/notification/ -> eznotificationcollectionitem.php (source)

   1  <?php
   2  //
   3  // Definition of eZNotificationCollectionItem class
   4  //
   5  // Created on: <09-May-2003 16:08:18 sp>
   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 eznotificationcollectionitem.php
  30  */
  31  
  32  /*!
  33    \class eZNotificationCollectionItem eznotificationcollectionitem.php
  34    \brief The class eZNotificationCollectionItem does
  35  
  36  */
  37  
  38  include_once ( "kernel/classes/ezpersistentobject.php" );
  39  
  40  class eZNotificationCollectionItem extends eZPersistentObject
  41  {
  42      /*!
  43       Constructor
  44      */
  45      function eZNotificationCollectionItem( $row = array() )
  46      {
  47          $this->eZPersistentObject( $row );
  48      }
  49  
  50      function definition()
  51      {
  52          return array( "fields" => array( "id" => array( 'name' => 'ID',
  53                                                          'datatype' => 'integer',
  54                                                          'default' => 0,
  55                                                          'required' => true ),
  56                                           "collection_id" => array( 'name' => "CollectionID",
  57                                                                     'datatype' => 'integer',
  58                                                                     'default' => 0,
  59                                                                     'required' => true,
  60                                                                     'foreign_class' => 'eZNotificationCollection',
  61                                                                     'foreign_attribute' => 'id',
  62                                                                     'multiplicity' => '1..*' ),
  63                                           "event_id" => array( 'name' => "EventID",
  64                                                                'datatype' => 'integer',
  65                                                                'default' => 0,
  66                                                                'required' => true,
  67                                                                'foreign_class' => 'eZNotificationEvent',
  68                                                                'foreign_attribute' => 'id',
  69                                                                'multiplicity' => '1..*' ),
  70                                           "address" => array( 'name' => "Address",
  71                                                               'datatype' => 'string',
  72                                                               'default' => '',
  73                                                               'required' => true ),
  74                                           "send_date" => array( 'name' => "SendDate",
  75                                                                 'datatype' => 'integer',
  76                                                                 'default' => 0,
  77                                                                 'required' => true )  ),
  78                        "keys" => array( "id" ),
  79                        "increment_key" => "id",
  80                        "sort" => array( "id" => "asc" ),
  81                        "class_name" => "eZNotificationCollectionItem",
  82                        "name" => "eznotificationcollection_item" );
  83      }
  84  
  85      function create( $collectionID, $eventID, $address, $sendDate = 0 )
  86      {
  87          return new eZNotificationCollectionItem( array( 'collection_id' => $collectionID,
  88                                                          'event_id' => $eventID,
  89                                                          'address' => $address,
  90                                                          'send_date' => $sendDate ) );
  91      }
  92  
  93      function fetchByDate( $date )
  94      {
  95          return eZPersistentObject::fetchObjectList( eZNotificationCollectionItem::definition(),
  96                                                      null, array( 'send_date' => array( '<', $date ),
  97                                                                   'send_date' => array( '!=', 0 ) ) , null,null,
  98                                                      true );
  99      }
 100  
 101      function fetchCountForEvent( $eventID )
 102      {
 103          $result = eZPersistentObject::fetchObjectList( eZNotificationCollectionItem::definition(),
 104                                                          array(), array( 'event_id' => $eventID ), array(),null,
 105                                                          false,false, array( array( 'operation' => 'count(*)',
 106                                                                                     'name' => 'count' ) ) );
 107          return $result[0]['count'];
 108      }
 109  
 110      /*!
 111       \static
 112       Removes all notification collection items.
 113      */
 114      function cleanup()
 115      {
 116          $db =& eZDB::instance();
 117          $db->query( "DELETE FROM eznotificationcollection_item" );
 118      }
 119  }
 120  
 121  ?>


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