Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eznotificationcollectionitem.php
Go to the documentation of this file.
1 <?php
17 class eZNotificationCollectionItem extends eZPersistentObject
18 {
19 static function definition()
20 {
21 return array( "fields" => array( "id" => array( 'name' => 'ID',
22 'datatype' => 'integer',
23 'default' => 0,
24 'required' => true ),
25 "collection_id" => array( 'name' => "CollectionID",
26 'datatype' => 'integer',
27 'default' => 0,
28 'required' => true,
29 'foreign_class' => 'eZNotificationCollection',
30 'foreign_attribute' => 'id',
31 'multiplicity' => '1..*' ),
32 "event_id" => array( 'name' => "EventID",
33 'datatype' => 'integer',
34 'default' => 0,
35 'required' => true,
36 'foreign_class' => 'eZNotificationEvent',
37 'foreign_attribute' => 'id',
38 'multiplicity' => '1..*' ),
39 "address" => array( 'name' => "Address",
40 'datatype' => 'string',
41 'default' => '',
42 'required' => true ),
43 "send_date" => array( 'name' => "SendDate",
44 'datatype' => 'integer',
45 'default' => 0,
46 'required' => true ) ),
47 "keys" => array( "id" ),
48 "increment_key" => "id",
49 "sort" => array( "id" => "asc" ),
50 "class_name" => "eZNotificationCollectionItem",
51 "name" => "eznotificationcollection_item" );
52 }
53
54 static function create( $collectionID, $eventID, $address, $sendDate = 0 )
55 {
56 return new eZNotificationCollectionItem( array( 'collection_id' => $collectionID,
57 'event_id' => $eventID,
58 'address' => $address,
59 'send_date' => $sendDate ) );
60 }
61
62 static function fetchByDate( $date )
63 {
64 return eZPersistentObject::fetchObjectList( eZNotificationCollectionItem::definition(),
65 null, array( 'send_date' => array( '<', $date ),
66 'send_date' => array( '!=', 0 ) ) , null, null,
67 true );
68 }
69
70 static function fetchCountForEvent( $eventID )
71 {
72 $result = eZPersistentObject::fetchObjectList( eZNotificationCollectionItem::definition(),
73 array(),
74 array( 'event_id' => $eventID ),
75 false,
76 null,
77 false,
78 false,
79 array( array( 'operation' => 'count( * )',
80 'name' => 'count' ) ) );
81 return $result[0]['count'];
82 }
83
88 static function cleanup()
89 {
90 $db = eZDB::instance();
91 $db->query( "DELETE FROM eznotificationcollection_item" );
92 }
93 }
94
95 ?>
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZNotificationCollectionItem
The class eZNotificationCollectionItem does.
Definition: eznotificationcollectionitem.php:18
eZNotificationCollectionItem\fetchCountForEvent
static fetchCountForEvent( $eventID)
Definition: eznotificationcollectionitem.php:70
eZNotificationCollectionItem\fetchByDate
static fetchByDate( $date)
Definition: eznotificationcollectionitem.php:62
eZNotificationCollectionItem\create
static create( $collectionID, $eventID, $address, $sendDate=0)
Definition: eznotificationcollectionitem.php:54
eZNotificationCollectionItem\cleanup
static cleanup()
Definition: eznotificationcollectionitem.php:88
eZNotificationCollectionItem\definition
static definition()
Definition: eznotificationcollectionitem.php:19
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\fetchObjectList
static fetchObjectList( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
Definition: ezpersistentobject.php:806
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.