[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Definition of eZCollaborationNotificationRule class 4 // 5 // Created on: <09-Jul-2003 16:36:55 amos> 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 ezcollaborationnotificationrule.php 30 */ 31 32 /*! 33 \class eZCollaborationNotificationRule ezcollaborationnotificationrule.php 34 \brief The class eZCollaborationNotificationRule does 35 36 */ 37 include_once ( 'kernel/classes/ezcontentobjecttreenode.php' ); 38 39 class eZCollaborationNotificationRule extends eZPersistentObject 40 { 41 /*! 42 Constructor 43 */ 44 function eZCollaborationNotificationRule( $row ) 45 { 46 $this->eZPersistentObject( $row ); 47 } 48 49 function definition() 50 { 51 return array( "fields" => array( "id" => array( 'name' => 'ID', 52 'datatype' => 'integer', 53 'default' => 0, 54 'required' => true ), 55 "user_id" => array( 'name' => "UserID", 56 'datatype' => 'integer', 57 'default' => 0, 58 'required' => true, 59 'foreign_class' => 'eZUser', 60 'foreign_attribute' => 'contentobject_id', 61 'multiplicity' => '1..*' ), 62 "collab_identifier" => array( 'name' => "CollaborationIdentifier", 63 'datatype' => 'string', 64 'default' => '', 65 'required' => true ) ), 66 "keys" => array( "id" ), 67 "function_attributes" => array( 'user' => 'user' ), 68 "increment_key" => "id", 69 "sort" => array( "id" => "asc" ), 70 "class_name" => "eZCollaborationNotificationRule", 71 "name" => "ezcollab_notification_rule" ); 72 } 73 74 function &user() 75 { 76 $user = eZUser::fetch( $this->attribute( 'user_id' ) ); 77 return $user; 78 } 79 80 function create( $collaborationIdentifier, $userID = false ) 81 { 82 if ( !$userID ) 83 $userID = eZUser::currentUserID(); 84 $rule = new eZCollaborationNotificationRule( array( 'user_id' => $userID, 85 'collab_identifier' => $collaborationIdentifier ) ); 86 return $rule; 87 } 88 89 function fetchList( $userID = false, $asObject = true ) 90 { 91 if ( !$userID ) 92 $userID = eZUser::currentUserID(); 93 return eZPersistentObject::fetchObjectList( eZCollaborationNotificationRule::definition(), 94 null, array( 'user_id' => $userID ), 95 null, null, $asObject ); 96 } 97 98 function &fetchItemTypeList( $collaborationIdentifier, $userIDList, $asObject = true ) 99 { 100 if ( is_array( $collaborationIdentifier ) ) 101 $collaborationIdentifier = array( $collaborationIdentifier ); 102 $objectList = eZPersistentObject::fetchObjectList( eZCollaborationNotificationRule::definition(), 103 null, array( 'user_id' => array( $userIDList ), 104 'collab_identifier' => $collaborationIdentifier ), 105 null, null, $asObject ); 106 return $objectList; 107 } 108 109 // function &fetchUserList( $nodeIDList ) 110 // { 111 // $rules = eZPersistentObject::fetchObjectList( eZCollaborationNotificationRule::definition(), 112 // array(), array( 'node_id' => array( $nodeIDList ) ), 113 // array( 'address' => 'asc' , 'use_digest' => 'desc' ),null, 114 // false, false, array( array( 'operation' => 'distinct address,use_digest' ) ) ); 115 // return $rules; 116 // } 117 118 // function node() 119 // { 120 // if ( $this->Node == null ) 121 // { 122 // $this->Node = eZContentObjectTreeNode::fetch( $this->attribute( 'node_id' ) ); 123 // } 124 // return $this->Node; 125 // } 126 127 function removeByIdentifier( $collaborationIdentifier, $userID = false ) 128 { 129 if ( !$userID ) 130 $userID = eZUser::currentUserID(); 131 eZPersistentObject::removeObject( eZCollaborationNotificationRule::definition(), 132 array( 'collab_identifier' => $collaborationIdentifier, 133 'user_id' => $userID ) ); 134 } 135 136 // function removeByNodeAndAddress( $address, $nodeID ) 137 // { 138 // eZPersistentObject::removeObject( eZCollaborationNotificationRule::definition(), array( 'address' => $address, 139 // 'node_id' => $nodeID ) ); 140 // } 141 // var $Node = null; 142 143 /*! 144 \static 145 Removes all notification rules for all collaboration items for all users. 146 */ 147 function cleanup() 148 { 149 $db =& eZDB::instance(); 150 $db->query( "DELETE FROM ezcollab_notification_rule" ); 151 } 152 } 153 154 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |