Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezpendingactions.php
Go to the documentation of this file.
1 <?php
11 class eZPendingActions extends eZPersistentObject
12 {
19 public static function definition()
20 {
21 return array(
22 'fields' => array(
23 'id' => array(
24 'name' => 'id',
25 'datatype' => 'integer',
26 'default' => 0,
27 'required' => true
28 ),
29 'action' => array(
30 'name' => 'action',
31 'datatype' => 'string',
32 'default' => null,
33 'required' => true
34 ),
35 'created' => array(
36 'name' => 'created',
37 'datatype' => 'integer',
38 'default' => null,
39 'required' => false
40 ),
41 'param' => array(
42 'name' => 'param',
43 'datatype' => 'string',
44 'default' => null,
45 'required' => false
46 )
47 ),
48 'keys' => array( 'id' ),
49 'class_name' => 'eZPendingActions',
50 'name' => 'ezpending_actions',
51 'function_attributes' => array()
52 );
53 }
54
63 public static function fetchByAction( $action, array $aCreationDateFilter = array() )
64 {
65 $filterConds = array( 'action' => $action );
66
67 // Handle creation date filter
68 if( !empty( $aCreationDateFilter ) )
69 {
70 if( count( $aCreationDateFilter ) != 2 )
71 {
72 eZDebug::writeError( __CLASS__.'::'.__METHOD__.' : Wrong number of entries for Creation date filter array' );
73 return null;
74 }
75
76 list( $filterToken, $filterValue ) = $aCreationDateFilter;
77 $aAuthorizedFilterTokens = array( '=', '<', '>', '<=', '>=' );
78 if( !is_string( $filterToken ) || !in_array( $filterToken, $aAuthorizedFilterTokens ) )
79 {
80 eZDebug::writeError( __CLASS__.'::'.__METHOD__.' : Wrong filter type for creation date filter' );
81 return null;
82 }
83
84 $filterConds['created'] = array( $filterToken, $filterValue );
85 }
86
87 $result = parent::fetchObjectList( self::definition(), null, $filterConds );
88
89 return $result;
90 }
91
98 public static function removeByAction( $action, array $filterConds = array() )
99 {
100 parent::removeObject( self::definition(), array( 'action' => $action ) + $filterConds );
101 }
102 }
103
104 ?>
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZPendingActions
Definition: ezpendingactions.php:12
eZPendingActions\fetchByAction
static fetchByAction( $action, array $aCreationDateFilter=array())
Definition: ezpendingactions.php:63
eZPendingActions\removeByAction
static removeByAction( $action, array $filterConds=array())
Definition: ezpendingactions.php:98
eZPendingActions\definition
static definition()
Definition: ezpendingactions.php:19
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\count
static count( $def, $conds=null, $field=null)
Definition: ezpersistentobject.php:187
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.