Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezpolicylimitationvalue.php
Go to the documentation of this file.
1 <?php
17 class eZPolicyLimitationValue extends eZPersistentObject
18 {
19 public $LimitationID;
20 public $Value;
21 public $Values;
22
23 static function definition()
24 {
25 static $definition = array( "fields" => array( "id" => array( 'name' => 'ID',
26 'datatype' => 'integer',
27 'default' => 0,
28 'required' => true ),
29 'limitation_id' => array( 'name' => 'LimitationID',
30 'datatype' => 'integer',
31 'default' => 0,
32 'required' => true,
33 'foreign_class' => 'eZPolicyLimitation',
34 'foreign_attribute' => 'id',
35 'multiplicity' => '1..*' ),
36 'value' => array( 'name' => 'Value',
37 'datatype' => 'text',
38 'default' => '',
39 'required' => true ) ),
40 "keys" => array( "id" ),
41 "increment_key" => "id",
42 "sort" => array( "value" => "asc" ),
43 "class_name" => "eZPolicyLimitationValue",
44 "name" => "ezpolicy_limitation_value" );
45 return $definition;
46 }
47
48
53 static function createNew( $limitationID, $value )
54 {
55 $limitationValue = new eZPolicyLimitationValue( array() );
56 $limitationValue->setAttribute( 'limitation_id', $limitationID );
57 $limitationValue->setAttribute( 'value', $value );
58 $limitationValue->store();
59
60 return $limitationValue;
61 }
62
68 static function create( $limitationID, $value )
69 {
70 $row = array( 'id' => null,
71 'limitation_id' => $limitationID,
72 'value' => $value );
73 return new eZPolicyLimitationValue( $row );
74 }
75
80 function copy( $limitationID )
81 {
82 $newValue = eZPolicyLimitationValue::createNew( $limitationID, $this->attribute( 'value' ) );
83 }
84
85 static function fetchList( $limitationID, $asObject = true )
86 {
87 return eZPersistentObject::fetchObjectList( eZPolicyLimitationValue::definition(),
88 null,
89 array( 'limitation_id' => $limitationID ),
90 null,
91 null,
92 $asObject );
93 }
94
99 static function removeByValue( $value, $policyID = false )
100 {
101 if ( $policyID )
102 {
103 $limitationIDList = array();
104 $limitations = eZPolicyLimitation::fetchByPolicyID( $policyID, false );
105 foreach ( $limitations as $limitationArray )
106 {
107 $limitationIDList[] = $limitationArray['id'];
108 }
109 if ( count( $limitationIDList ) > 0 )
110 {
111 eZPersistentObject::removeObject( eZPolicyLimitationValue::definition(),
112 array( 'limitation_id' => array( $limitationIDList ),
113 "value" => $value ) );
114 return;
115 }
116 }
117 eZPersistentObject::removeObject( eZPolicyLimitationValue::definition(),
118 array( "value" => $value ) );
119 }
120 }
121
122 ?>
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\removeObject
static removeObject( $def, $conditions=null, $extraConditions=null)
Definition: ezpersistentobject.php:271
eZPersistentObject\count
static count( $def, $conds=null, $field=null)
Definition: ezpersistentobject.php:187
eZPersistentObject\attribute
attribute( $attr, $noFunction=false)
Definition: ezpersistentobject.php:1329
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
eZPolicyLimitationValue
Defines a limitation value for a policy in the permission system.
Definition: ezpolicylimitationvalue.php:18
eZPolicyLimitationValue\fetchList
static fetchList( $limitationID, $asObject=true)
Definition: ezpolicylimitationvalue.php:85
eZPolicyLimitationValue\$Values
$Values
Definition: ezpolicylimitationvalue.php:21
eZPolicyLimitationValue\definition
static definition()
Definition: ezpolicylimitationvalue.php:23
eZPolicyLimitationValue\$Value
$Value
Definition: ezpolicylimitationvalue.php:20
eZPolicyLimitationValue\removeByValue
static removeByValue( $value, $policyID=false)
Definition: ezpolicylimitationvalue.php:99
eZPolicyLimitationValue\copy
copy( $limitationID)
Definition: ezpolicylimitationvalue.php:80
eZPolicyLimitationValue\$LimitationID
$LimitationID
Definition: ezpolicylimitationvalue.php:19
eZPolicyLimitationValue\createNew
static createNew( $limitationID, $value)
Definition: ezpolicylimitationvalue.php:53
eZPolicyLimitationValue\create
static create( $limitationID, $value)
Definition: ezpolicylimitationvalue.php:68
eZPolicyLimitation\fetchByPolicyID
static fetchByPolicyID( $policyID, $asObject=true)
Definition: ezpolicylimitation.php:142
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.