Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcontentclassgroup.php
Go to the documentation of this file.
1 <?php
13
17 class eZContentClassGroup extends eZPersistentObject
18 {
19 static function definition()
20 {
21 return array( "fields" => array( "id" => array( 'name' => 'ID',
22 'datatype' => 'integer',
23 'default' => 0,
24 'required' => true ),
25 "name" => array( 'name' => "Name",
26 'datatype' => 'string',
27 'default' => '',
28 'required' => true ),
29 "creator_id" => array( 'name' => "CreatorID",
30 'datatype' => 'integer',
31 'default' => 0,
32 'required' => true,
33 'foreign_class' => 'eZUser',
34 'foreign_attribute' => 'contentobject_id',
35 'multiplicity' => '1..*' ),
36 "modifier_id" => array( 'name' => "ModifierID",
37 'datatype' => 'integer',
38 'default' => 0,
39 'required' => true,
40 'foreign_class' => 'eZUser',
41 'foreign_attribute' => 'contentobject_id',
42 'multiplicity' => '1..*' ),
43 "created" => array( 'name' => "Created",
44 'datatype' => 'integer',
45 'default' => 0,
46 'required' => true ),
47 "modified" => array( 'name' => "Modified",
48 'datatype' => 'integer',
49 'default' => 0,
50 'required' => true ) ),
51 "keys" => array( "id" ),
52 'function_attributes' => array( 'modifier' => 'modifier',
53 'creator' => 'creator' ),
54 "increment_key" => "id",
55 "class_name" => "eZContentClassGroup",
56 "sort" => array( "id" => "asc" ),
57 "name" => "ezcontentclassgroup" );
58 }
59
60 static function create( $userID = false )
61 {
62 $dateTime = time();
63 if ( !$userID )
64 $userID = eZUser::currentUserID();
65 $row = array(
66 "id" => null,
67 "name" => "",
68 "creator_id" => $userID,
69 "modifier_id" => $userID,
70 "created" => $dateTime,
71 "modified" => $dateTime );
72 return new eZContentClassGroup( $row );
73 }
74
75 function modifier()
76 {
77 if ( isset( $this->ModifierID ) and $this->ModifierID )
78 {
79 return eZUser::fetch( $this->ModifierID );
80 }
81 return null;
82 }
83
84 function creator()
85 {
86 if ( isset( $this->CreatorID ) and $this->CreatorID )
87 {
88 return eZUser::fetch( $this->CreatorID );
89 }
90 return null;
91 }
92
97 static function removeSelected( $id )
98 {
99 eZPersistentObject::removeObject( eZContentClassGroup::definition(),
100 array( "id" => $id ) );
101 }
102
109 static function fetchByName( $name, $asObject = true )
110 {
111 $conds = array( 'name' => $name );
112 return eZPersistentObject::fetchObject( eZContentClassGroup::definition(),
113 null,
114 $conds,
115 $asObject );
116 }
117
118 static function fetch( $id, $user_id = false, $asObject = true )
119 {
120 $conds = array( "id" => $id );
121 if ( $user_id !== false and is_numeric( $user_id ) )
122 $conds["creator_id"] = $user_id;
123 return eZPersistentObject::fetchObject( eZContentClassGroup::definition(),
124 null,
125 $conds,
126 $asObject );
127 }
128
129 static function fetchList( $user_id = false, $asObject = true )
130 {
131 $conds = array();
132 if ( $user_id !== false and is_numeric( $user_id ) )
133 $conds["creator_id"] = $user_id;
134 return eZPersistentObject::fetchObjectList( eZContentClassGroup::definition(),
135 null, $conds, null, null,
136 $asObject );
137 }
138
145 function appendClass( $class, $version = false )
146 {
147 if ( $class instanceof eZContentClass )
148 {
149 $classID = $class->attribute( 'id' );
150 $version = $class->attribute( 'version' );
151 }
152 else
153 {
154 $classID = $class;
155 }
156 $classGroupLink = eZContentClassClassGroup::create( $classID,
157 $version,
158 $this->attribute( 'id' ),
159 $this->attribute( 'name' ) );
160 $classGroupLink->store();
161 return $classGroupLink;
162 }
163
164 public $ID;
165 public $Name;
166 public $CreatorID;
167 public $ModifierID;
168 public $Created;
169 public $Modified;
170 }
171
172 ?>
eZContentClassClassGroup\create
static create( $contentclass_id, $contentclass_version, $group_id, $group_name)
Definition: ezcontentclassclassgroup.php:47
eZContentClassGroup
Definition: ezcontentclassgroup.php:18
eZContentClassGroup\fetch
static fetch( $id, $user_id=false, $asObject=true)
Definition: ezcontentclassgroup.php:118
eZContentClassGroup\fetchList
static fetchList( $user_id=false, $asObject=true)
Definition: ezcontentclassgroup.php:129
eZContentClassGroup\fetchByName
static fetchByName( $name, $asObject=true)
Definition: ezcontentclassgroup.php:109
eZContentClassGroup\definition
static definition()
Definition: ezcontentclassgroup.php:19
eZContentClassGroup\$Modified
$Modified
Definition: ezcontentclassgroup.php:169
eZContentClassGroup\removeSelected
static removeSelected( $id)
Definition: ezcontentclassgroup.php:97
eZContentClassGroup\modifier
modifier()
Definition: ezcontentclassgroup.php:75
eZContentClassGroup\$Name
$Name
Definition: ezcontentclassgroup.php:165
eZContentClassGroup\$ID
$ID
Definition: ezcontentclassgroup.php:164
eZContentClassGroup\$Created
$Created
Definition: ezcontentclassgroup.php:168
eZContentClassGroup\$ModifierID
$ModifierID
Definition: ezcontentclassgroup.php:167
eZContentClassGroup\create
static create( $userID=false)
Definition: ezcontentclassgroup.php:60
eZContentClassGroup\appendClass
appendClass( $class, $version=false)
Definition: ezcontentclassgroup.php:145
eZContentClassGroup\$CreatorID
$CreatorID
Definition: ezcontentclassgroup.php:166
eZContentClassGroup\creator
creator()
Definition: ezcontentclassgroup.php:84
eZContentClass
Handles eZ Publish content classes.
Definition: ezcontentclass.php:20
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
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
eZUser\fetch
static fetch( $id, $asObject=true)
Definition: ezuser.php:351
eZUser\currentUserID
static currentUserID()
Definition: ezuser.php:1731
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.