[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Definition of eZGeneralDigestUserSettings class 4 // 5 // Created on: <16-May-2003 13:06:24 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 ezgeneraldigestusersettings.php 30 */ 31 32 /*! 33 \class eZGeneralDigestUserSettings ezgeneraldigestusersettings.php 34 \brief The class eZGeneralDigestUserSettings does 35 36 */ 37 38 include_once ( 'kernel/classes/ezpersistentobject.php' ); 39 40 define( 'EZ_DIGEST_SETTINGS_TYPE_NONE', 0 ); 41 define( 'EZ_DIGEST_SETTINGS_TYPE_WEEKLY', 1 ); 42 define( 'EZ_DIGEST_SETTINGS_TYPE_MONTHLY', 2 ); 43 define( 'EZ_DIGEST_SETTINGS_TYPE_DAILY', 3 ); 44 45 class eZGeneralDigestUserSettings extends eZPersistentObject 46 { 47 /*! 48 Constructor 49 */ 50 function eZGeneralDigestUserSettings( $row ) 51 { 52 $this->eZPersistentObject( $row ); 53 } 54 55 function definition() 56 { 57 return array( "fields" => array( "id" => array( 'name' => 'ID', 58 'datatype' => 'integer', 59 'default' => 0, 60 'required' => true ), 61 "address" => array( 'name' => "Address", 62 'datatype' => 'string', 63 'default' => '', 64 'required' => true ), 65 "receive_digest" => array( 'name' => "ReceiveDigest", 66 'datatype' => 'integer', 67 'default' => 0, 68 'required' => true ), 69 "digest_type" => array( 'name' => "DigestType", 70 'datatype' => 'integer', 71 'default' => 0, 72 'required' => true ), 73 "day" => array( 'name' => "Day", 74 'datatype' => 'string', 75 'default' => '', 76 'required' => true ), 77 "time" => array( 'name' => "Time", 78 'datatype' => 'string', 79 'default' => '', 80 'required' => true ) ), 81 "keys" => array( "id" ), 82 "increment_key" => "id", 83 "sort" => array( "id" => "asc" ), 84 "class_name" => "eZGeneralDigestUserSettings", 85 "name" => "ezgeneral_digest_user_settings" ); 86 } 87 88 89 function create( $address, $receiveDigest = 0, $digestType = EZ_DIGEST_SETTINGS_TYPE_NONE, $day = '', $time = '' ) 90 { 91 return new eZGeneralDigestUserSettings( array( 'address' => $address, 92 'receive_digest' => $receiveDigest, 93 'digest_type' => $digestType, 94 'day' => $day, 95 'time' => $time ) ); 96 } 97 98 function fetchForUser( $address, $asObject = true ) 99 { 100 return eZPersistentObject::fetchObject( eZGeneralDigestUserSettings::definition(), 101 null, 102 array( 'address' => $address ), 103 $asObject ); 104 } 105 106 /*! 107 \static 108 Removes all general digest settings for all users. 109 */ 110 function cleanup() 111 { 112 $db =& eZDB::instance(); 113 $db->query( "DELETE FROM ezgeneral_digest_user_settings" ); 114 } 115 } 116 117 ?>
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 |