Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcollaborationnotificationrule.php
Go to the documentation of this file.
1 <?php
16 class eZCollaborationNotificationRule extends eZPersistentObject
17 {
18 static function definition()
19 {
20 return array( "fields" => array( "id" => array( 'name' => 'ID',
21 'datatype' => 'integer',
22 'default' => 0,
23 'required' => true ),
24 "user_id" => array( 'name' => "UserID",
25 'datatype' => 'integer',
26 'default' => 0,
27 'required' => true,
28 'foreign_class' => 'eZUser',
29 'foreign_attribute' => 'contentobject_id',
30 'multiplicity' => '1..*' ),
31 "collab_identifier" => array( 'name' => "CollaborationIdentifier",
32 'datatype' => 'string',
33 'default' => '',
34 'required' => true ) ),
35 "keys" => array( "id" ),
36 "function_attributes" => array( 'user' => 'user' ),
37 "increment_key" => "id",
38 "sort" => array( "id" => "asc" ),
39 "class_name" => "eZCollaborationNotificationRule",
40 "name" => "ezcollab_notification_rule" );
41 }
42
43 function user()
44 {
45 return eZUser::fetch( $this->attribute( 'user_id' ) );
46 }
47
48 static function create( $collaborationIdentifier, $userID = false )
49 {
50 if ( !$userID )
51 $userID = eZUser::currentUserID();
52 return new eZCollaborationNotificationRule( array( 'user_id' => $userID,
53 'collab_identifier' => $collaborationIdentifier ) );
54 }
55
56 static function fetchList( $userID = false, $asObject = true )
57 {
58 if ( !$userID )
59 $userID = eZUser::currentUserID();
60 return eZPersistentObject::fetchObjectList( eZCollaborationNotificationRule::definition(),
61 null, array( 'user_id' => $userID ),
62 null, null, $asObject );
63 }
64
65 static function fetchItemTypeList( $collaborationIdentifier, $userIDList, $asObject = true )
66 {
67 if ( is_array( $collaborationIdentifier ) )
68 $collaborationIdentifier = array( $collaborationIdentifier );
69 return eZPersistentObject::fetchObjectList( eZCollaborationNotificationRule::definition(),
70 null, array( 'user_id' => array( $userIDList ),
71 'collab_identifier' => $collaborationIdentifier ),
72 null, null, $asObject );
73 }
74
75 static function removeByIdentifier( $collaborationIdentifier, $userID = false )
76 {
77 if ( !$userID )
78 $userID = eZUser::currentUserID();
79 eZPersistentObject::removeObject( eZCollaborationNotificationRule::definition(),
80 array( 'collab_identifier' => $collaborationIdentifier,
81 'user_id' => $userID ) );
82 }
83
91 static function removeByUserID( $userID )
92 {
93 eZPersistentObject::removeObject( eZCollaborationNotificationRule::definition(), array( 'user_id' => $userID ) );
94 }
95
100 static function cleanup()
101 {
102 $db = eZDB::instance();
103 $db->query( "DELETE FROM ezcollab_notification_rule" );
104 }
105 }
106
107 ?>
eZCollaborationNotificationRule
The class eZCollaborationNotificationRule does.
Definition: ezcollaborationnotificationrule.php:17
eZCollaborationNotificationRule\create
static create( $collaborationIdentifier, $userID=false)
Definition: ezcollaborationnotificationrule.php:48
eZCollaborationNotificationRule\definition
static definition()
Definition: ezcollaborationnotificationrule.php:18
eZCollaborationNotificationRule\removeByIdentifier
static removeByIdentifier( $collaborationIdentifier, $userID=false)
Definition: ezcollaborationnotificationrule.php:75
eZCollaborationNotificationRule\user
user()
Definition: ezcollaborationnotificationrule.php:43
eZCollaborationNotificationRule\removeByUserID
static removeByUserID( $userID)
Definition: ezcollaborationnotificationrule.php:91
eZCollaborationNotificationRule\cleanup
static cleanup()
Definition: ezcollaborationnotificationrule.php:100
eZCollaborationNotificationRule\fetchItemTypeList
static fetchItemTypeList( $collaborationIdentifier, $userIDList, $asObject=true)
Definition: ezcollaborationnotificationrule.php:65
eZCollaborationNotificationRule\fetchList
static fetchList( $userID=false, $asObject=true)
Definition: ezcollaborationnotificationrule.php:56
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\removeObject
static removeObject( $def, $conditions=null, $extraConditions=null)
Definition: ezpersistentobject.php:271
eZPersistentObject\attribute
attribute( $attr, $noFunction=false)
Definition: ezpersistentobject.php:1329
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
eZUser\fetch
static fetch( $id, $asObject=true)
Definition: ezuser.php:351
eZUser\currentUserID
static currentUserID()
Definition: ezuser.php:1731
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.