Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezinformationcollectionattribute.php
Go to the documentation of this file.
1 <?php
18 class eZInformationCollectionAttribute extends eZPersistentObject
19 {
20 public $ContentClassAttributeID;
21 public function __construct( $row )
22 {
23 $this->Content = null;
24 parent::__construct( $row );
25 }
26
30 static function definition()
31 {
32 return array( 'fields' => array( 'id' => array( 'name' => 'ID',
33 'datatype' => 'integer',
34 'default' => 0,
35 'required' => true ),
36 'informationcollection_id' => array( 'name' => 'InformationCollectionID',
37 'datatype' => 'integer',
38 'default' => 0,
39 'required' => true,
40 'foreign_class' => 'eZInformationCollection',
41 'foreign_attribute' => 'id',
42 'multiplicity' => '1..*' ),
43 'contentclass_attribute_id' => array( 'name' => 'ContentClassAttributeID',
44 'datatype' => 'integer',
45 'default' => 0,
46 'required' => true,
47 'foreign_class' => 'eZContentClassAttribute',
48 'foreign_attribute' => 'id',
49 'multiplicity' => '1..*' ),
50 'contentobject_attribute_id' => array( 'name' => 'ContentObjectAttributeID',
51 'datatype' => 'integer',
52 'default' => 0,
53 'required' => true,
54 'foreign_class' => 'eZContentObjectAttribute',
55 'foreign_attribute' => 'id',
56 'multiplicity' => '1..*' ),
57 'contentobject_id' => array( 'name' => 'ContentObjectID',
58 'datatype' => 'integer',
59 'default' => 0,
60 'required' => true,
61 'foreign_class' => 'eZContentObject',
62 'foreign_attribute' => 'id',
63 'multiplicity' => '1..*' ),
64 'data_text' => array( 'name' => 'DataText',
65 'datatype' => 'text',
66 'default' => '',
67 'required' => true ),
68 'data_int' => array( 'name' => 'DataInt',
69 'datatype' => 'integer',
70 'default' => null,
71 'required' => true ),
72 'data_float' => array( 'name' => 'DataFloat',
73 'datatype' => 'float',
74 'default' => 0,
75 'required' => true ) ),
76 'keys' => array( 'id' ),
77 'function_attributes' => array( 'contentclass_attribute_name' => 'contentClassAttributeName',
78 'contentclass_attribute' => 'contentClassAttribute',
79 'contentobject_attribute' => 'contentObjectAttribute',
80 'contentobject' => 'contentObject',
81 'result_template' => 'resultTemplateName',
82 'has_content' => 'hasContent',
83 'content' => 'content',
84 'class_content' => 'classContent' ),
85 'increment_key' => 'id',
86 'class_name' => 'eZInformationCollectionAttribute',
87 'name' => 'ezinfocollection_attribute' );
88 }
89
93 function classContent()
94 {
95 $classAttribute = $this->contentClassAttribute();
96 if ( is_object( $classAttribute ) )
97 {
98 return $classAttribute->content();
99 }
100 return null;
101 }
102
106 function content()
107 {
108 if ( $this->Content === null )
109 {
110 $dataType = $this->dataType();
111 if ( is_object( $dataType ) )
112 {
113 $this->Content = $dataType->objectAttributeContent( $this );
114 }
115 }
116 return $this->Content;
117 }
118
124 function hasContent()
125 {
126 $dataType = $this->dataType();
127 if ( is_object( $dataType ) )
128 {
129 return $dataType->hasObjectAttributeContent( $this );
130 }
131 return false;
132 }
133
139 function resultTemplateName()
140 {
141 $dataType = $this->dataType();
142 if ( $dataType )
143 {
144 return $dataType->resultTemplate( $this );
145 }
146 return null;
147 }
148
149 function contentObject()
150 {
151 return eZContentObject::fetch( $this->attribute( 'contentobject_id' ) );
152 }
153
154 function contentObjectAttribute()
155 {
156 $contentObject = $this->contentObject();
157 return eZContentObjectAttribute::fetch( $this->attribute( 'contentobject_attribute_id' ), $contentObject->attribute( 'current_version' ) );
158 }
159
160 function contentClassAttribute()
161 {
162 return eZContentClassAttribute::fetch( $this->attribute( 'contentclass_attribute_id' ) );
163 }
164
165 function dataType()
166 {
167 $contentClassAttribute = $this->contentClassAttribute();
168 if ( $contentClassAttribute )
169 return $contentClassAttribute->dataType();
170 return null;
171 }
172
173 function contentClassAttributeName()
174 {
175 $db = eZDB::instance();
176 $nameArray = $db->arrayQuery( "SELECT serialized_name_list FROM ezcontentclass_attribute WHERE id='$this->ContentClassAttributeID'" );
177
178 return eZSerializedObjectNameList::nameFromSerializedString( $nameArray[0]['serialized_name_list'] );
179 }
180
184 static function create( $informationCollectionID )
185 {
186 $row = array( 'informationcollection_id' => $informationCollectionID );
187 return new eZInformationCollectionAttribute( $row );
188 }
189
194 static function fetchByObjectAttributeID( $id, $contentobjectAttributeID, $asObject = true )
195 {
196 return eZPersistentObject::fetchObject( eZInformationCollectionAttribute::definition(),
197 null,
198 array( 'informationcollection_id' => $id,
199 'contentobject_attribute_id' => $contentobjectAttributeID ),
200 $asObject );
201 }
202
209 static function cleanup()
210 {
211 $db = eZDB::instance();
212 $db->query( "DELETE FROM ezinfocollection_attribute" );
213 }
214
215 // Contains the content for this attribute
216 public $Content;
217 }
218
219 ?>
eZContentClassAttribute\fetch
static fetch( $id, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $field_filters=null)
Definition: ezcontentclassattribute.php:380
eZContentObjectAttribute\fetch
static fetch( $id, $version, $asObject=true, $field_filters=null)
Definition: ezcontentobjectattribute.php:136
eZContentObject\fetch
static fetch( $id, $asObject=true)
Definition: ezcontentobject.php:885
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZInformationCollectionAttribute
The class eZInformationCollectionAttribute handles collected attribute information.
Definition: ezinformationcollectionattribute.php:19
eZInformationCollectionAttribute\$ContentClassAttributeID
$ContentClassAttributeID
Definition: ezinformationcollectionattribute.php:20
eZInformationCollectionAttribute\contentClassAttributeName
contentClassAttributeName()
Definition: ezinformationcollectionattribute.php:173
eZInformationCollectionAttribute\contentClassAttribute
contentClassAttribute()
Definition: ezinformationcollectionattribute.php:160
eZInformationCollectionAttribute\$Content
$Content
Definition: ezinformationcollectionattribute.php:216
eZInformationCollectionAttribute\resultTemplateName
resultTemplateName()
Definition: ezinformationcollectionattribute.php:139
eZInformationCollectionAttribute\__construct
__construct( $row)
Definition: ezinformationcollectionattribute.php:21
eZInformationCollectionAttribute\contentObject
contentObject()
Definition: ezinformationcollectionattribute.php:149
eZInformationCollectionAttribute\definition
static definition()
Definition: ezinformationcollectionattribute.php:30
eZInformationCollectionAttribute\fetchByObjectAttributeID
static fetchByObjectAttributeID( $id, $contentobjectAttributeID, $asObject=true)
Definition: ezinformationcollectionattribute.php:194
eZInformationCollectionAttribute\classContent
classContent()
Definition: ezinformationcollectionattribute.php:93
eZInformationCollectionAttribute\cleanup
static cleanup()
Definition: ezinformationcollectionattribute.php:209
eZInformationCollectionAttribute\create
static create( $informationCollectionID)
Definition: ezinformationcollectionattribute.php:184
eZInformationCollectionAttribute\hasContent
hasContent()
Definition: ezinformationcollectionattribute.php:124
eZInformationCollectionAttribute\content
content()
Definition: ezinformationcollectionattribute.php:106
eZInformationCollectionAttribute\dataType
dataType()
Definition: ezinformationcollectionattribute.php:165
eZInformationCollectionAttribute\contentObjectAttribute
contentObjectAttribute()
Definition: ezinformationcollectionattribute.php:154
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\attribute
attribute( $attr, $noFunction=false)
Definition: ezpersistentobject.php:1329
eZSerializedObjectNameList\nameFromSerializedString
static nameFromSerializedString( $serializedNames, $languageLocale=false)
Definition: ezserializedobjectnamelist.php:267
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.