Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcollaborationitemgrouplink.php
Go to the documentation of this file.
1 <?php
17 class eZCollaborationItemGroupLink extends eZPersistentObject
18 {
19 static function definition()
20 {
21 return array( 'fields' => array( 'collaboration_id' => array( 'name' => 'CollaborationID',
22 'datatype' => 'integer',
23 'default' => 0,
24 'required' => true,
25 'foreign_class' => 'eZCollaborationItem',
26 'foreign_attribute' => 'id',
27 'multiplicity' => '1..*' ),
28 'group_id' => array( 'name' => 'GroupID',
29 'datatype' => 'integer',
30 'default' => 0,
31 'required' => true,
32 'foreign_class' => 'eZCollaborationGroup',
33 'foreign_attribute' => 'id',
34 'multiplicity' => '1..*' ),
35 'user_id' => array( 'name' => 'UserID',
36 'datatype' => 'integer',
37 'default' => 0,
38 'required' => true,
39 'foreign_class' => 'eZUser',
40 'foreign_attribute' => 'contentobject_id',
41 'multiplicity' => '1..*' ),
42 'is_read' => array( 'name' => 'IsRead',
43 'datatype' => 'integer',
44 'default' => 0,
45 'required' => true ),
46 'is_active' => array( 'name' => 'IsActive',
47 'datatype' => 'integer',
48 'default' => 1,
49 'required' => true ),
50 'last_read' => array( 'name' => 'LastRead',
51 'datatype' => 'integer',
52 'default' => 0,
53 'required' => true ),
54 'created' => array( 'name' => 'Created',
55 'datatype' => 'integer',
56 'default' => 0,
57 'required' => true ),
58 'modified' => array( 'name' => 'Modified',
59 'datatype' => 'integer',
60 'default' => 0,
61 'required' => true ) ),
62 'keys' => array( 'collaboration_id', 'group_id', 'user_id' ),
63 'function_attributes' => array( 'user' => 'user',
64 'collaboration_item' => 'collaborationItem',
65 'collaboration_group' => 'collaborationGroup' ),
66 'class_name' => 'eZCollaborationItemGroupLink',
67 'sort' => array( 'modified' => 'asc' ),
68 'name' => 'ezcollab_item_group_link' );
69 }
70
71 static function create( $collaborationID, $groupID, $userID )
72 {
73 $date_time = time();
74 $row = array(
75 'collaboration_id' => $collaborationID,
76 'group_id' => $groupID,
77 'is_read' => false,
78 'is_active' => true,
79 'last_read' => 0,
80 'user_id' => $userID,
81 'created' => $date_time,
82 'modified' => $date_time );
83 return new eZCollaborationItemGroupLink( $row );
84 }
85
86 static function addItem( $groupID, $collaborationID, $userID )
87 {
88 $groupLink = eZCollaborationItemGroupLink::create( $collaborationID, $groupID, $userID );
89
90 $db = eZDB::instance();
91 $db->begin();
92 $groupLink->store();
93 $itemStatus = eZCollaborationItemStatus::create( $collaborationID, $userID );
94 $itemStatus->store();
95 $db->commit();
96
97 return $groupLink;
98 }
99
100 function fetch( $collaborationID, $groupID, $userID = false, $asObject = true )
101 {
102 if ( $userID == false )
103 {
104 $userID = eZUser::currentUserID();
105 }
106
107 return eZPersistentObject::fetchObject( eZCollaborationItemGroupLink::definition(),
108 null,
109 array( 'collaboration_id' => $collaborationID,
110 'group_id' => $groupID,
111 'user_id' => $userID ),
112 $asObject );
113 }
114
115 function fetchList( $collaborationID, $userID = false, $asObject = true )
116 {
117 if ( $userID == false )
118 {
119 $userID = eZUser::currentUserID();
120 }
121
122 return eZPersistentObject::fetchObjectList( eZCollaborationItemGroupLink::definition(),
123 null,
124 array( 'collaboration_id' => $collaborationID,
125 'user_id' => $userID ),
126 null, null,
127 $asObject );
128 }
129
130 function user()
131 {
132 if ( isset( $this->UserID ) and $this->UserID )
133 {
134 return eZUser::fetch( $this->UserID );
135 }
136 return null;
137 }
138
139 function collaborationItem()
140 {
141 if ( isset( $this->CollaborationID ) and $this->CollaborationID )
142 {
143 return eZCollaborationItem::fetch( $this->CollaborationID, $this->UserID );
144 }
145 return null;
146 }
147
148 function collaborationGroup()
149 {
150 if ( isset( $this->GroupID ) and $this->GroupID )
151 {
152 return eZCollaborationGroup::fetch( $this->GroupID, $this->UserID );
153 }
154 return null;
155 }
156
157
159 public $CollaborationID;
160 public $GroupID;
161 public $UserID;
162 public $Created;
163 public $Modified;
164 }
165
166 ?>
eZCollaborationGroup\fetch
static fetch( $id, $userID=false, $asObject=true)
Definition: ezcollaborationgroup.php:140
eZCollaborationItemGroupLink
The class eZCollaborationItemGroupLink does.
Definition: ezcollaborationitemgrouplink.php:18
eZCollaborationItemGroupLink\$GroupID
$GroupID
Definition: ezcollaborationitemgrouplink.php:160
eZCollaborationItemGroupLink\definition
static definition()
Definition: ezcollaborationitemgrouplink.php:19
eZCollaborationItemGroupLink\addItem
static addItem( $groupID, $collaborationID, $userID)
Definition: ezcollaborationitemgrouplink.php:86
eZCollaborationItemGroupLink\$Created
$Created
Definition: ezcollaborationitemgrouplink.php:162
eZCollaborationItemGroupLink\collaborationGroup
collaborationGroup()
Definition: ezcollaborationitemgrouplink.php:148
eZCollaborationItemGroupLink\$UserID
$UserID
Definition: ezcollaborationitemgrouplink.php:161
eZCollaborationItemGroupLink\create
static create( $collaborationID, $groupID, $userID)
Definition: ezcollaborationitemgrouplink.php:71
eZCollaborationItemGroupLink\collaborationItem
collaborationItem()
Definition: ezcollaborationitemgrouplink.php:139
eZCollaborationItemGroupLink\$CollaborationID
$CollaborationID
Definition: ezcollaborationitemgrouplink.php:159
eZCollaborationItemGroupLink\fetch
fetch( $collaborationID, $groupID, $userID=false, $asObject=true)
Definition: ezcollaborationitemgrouplink.php:100
eZCollaborationItemGroupLink\$Modified
$Modified
Definition: ezcollaborationitemgrouplink.php:163
eZCollaborationItemGroupLink\fetchList
fetchList( $collaborationID, $userID=false, $asObject=true)
Definition: ezcollaborationitemgrouplink.php:115
eZCollaborationItemGroupLink\user
user()
Definition: ezcollaborationitemgrouplink.php:130
eZCollaborationItemStatus\create
static create( $collaborationID, $userID=false)
Definition: ezcollaborationitemstatus.php:53
eZCollaborationItem\fetch
static fetch( $id, $creatorID=false, $asObject=true)
Definition: ezcollaborationitem.php:135
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\fetchObject
static fetchObject( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
Definition: ezpersistentobject.php:213
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+.