Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

eztipafriendcounter.php
Go to the documentation of this file.
1 <?php
13
17 class eZTipafriendCounter extends eZPersistentObject
18 {
19 static function definition()
20 {
21 return array( 'fields' => array( 'node_id' => array( 'name' => 'NodeID',
22 'datatype' => 'integer',
23 'default' => 0,
24 'required' => true,
25 'foreign_class' => 'eZContentObjectTreeNode',
26 'foreign_attribute' => 'node_id',
27 'multiplicity' => '1..*' ),
28 'count' => array( 'name' => 'Count', // deprecated column, must not be used
29 'datatype' => 'integer',
30 'default' => 0,
31 'required' => true ),
32 'requested' => array( 'name' => 'Requested',
33 'datatype' => 'integer',
34 'default' => 0,
35 'required' => true ) ),
36 'keys' => array( 'node_id', 'requested' ),
37 'relations' => array( 'node_id' => array( 'class' => 'eZContentObjectTreeNode',
38 'field' => 'node_id' ) ),
39 'class_name' => 'eZTipafriendCounter',
40 'sort' => array( 'count' => 'desc' ),
41 'name' => 'eztipafriend_counter' );
42 }
43
44 static function create( $nodeID )
45 {
46 return new eZTipafriendCounter( array( 'node_id' => $nodeID,
47 'count' => 0,
48 'requested' => time() ) );
49 }
50
55 static function removeForNode( $nodeID )
56 {
57 eZPersistentObject::removeObject( eZTipafriendCounter::definition(),
58 array( 'node_id' => $nodeID ) );
59 }
60
61 static function fetch( $nodeID, $asObject = true )
62 {
63 return eZPersistentObject::fetchObject( eZTipafriendCounter::definition(),
64 null,
65 array( 'node_id' => $nodeID ),
66 $asObject );
67 }
68
75 static function cleanup()
76 {
77 $db = eZDB::instance();
78 $db->query( "DELETE FROM eztipafriend_counter" );
79 }
80
82 public $NodeID;
83 public $Count;
84 }
85
86 ?>
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\removeObject
static removeObject( $def, $conditions=null, $extraConditions=null)
Definition: ezpersistentobject.php:271
eZTipafriendCounter
Definition: eztipafriendcounter.php:18
eZTipafriendCounter\$Count
$Count
Definition: eztipafriendcounter.php:83
eZTipafriendCounter\removeForNode
static removeForNode( $nodeID)
Definition: eztipafriendcounter.php:55
eZTipafriendCounter\definition
static definition()
Definition: eztipafriendcounter.php:19
eZTipafriendCounter\create
static create( $nodeID)
Definition: eztipafriendcounter.php:44
eZTipafriendCounter\fetch
static fetch( $nodeID, $asObject=true)
Definition: eztipafriendcounter.php:61
eZTipafriendCounter\$NodeID
$NodeID
Definition: eztipafriendcounter.php:82
eZTipafriendCounter\cleanup
static cleanup()
Definition: eztipafriendcounter.php:75
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.