Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

field.php
Go to the documentation of this file.
1 <?php
17 class ezpContentField
18 {
19 public function __construct()
20 {
21
22 }
23
29 public static function fromContentObjectAttribute( eZContentObjectAttribute $attribute )
30 {
31 $field = new self;
32 $field->attribute = $attribute;
33 return $field;
34 }
35
40 public function __toString()
41 {
42 if ( $this->attribute instanceof eZContentObjectAttribute )
43 return $this->attribute->toString();
44 else
45 return '';
46 }
47
48 public function __call( $method, $arguments )
49 {
50 if ( method_exists( $this->attribute, $method ) )
51 return call_user_func_array( array( $this->attribute, $method ), $arguments );
52 else
53 throw new ezcBasePropertyNotFoundException( $method );
54 }
55
56 public function __get( $property )
57 {
58 switch( $property )
59 {
60 // returns the serialized version of the attribute through the eZPackage mechanism
61
62 // Using package here is very problematic. Some serializations put
63 // content into the package, which is after this point, dangling.
64 case 'serializedXML':
65 return $this->attribute->serialize( new eZPackage );
66 break;
67 default:
68 if ( $this->attribute->hasAttribute( $property ) )
69 return $this->attribute->attribute( $property );
70 else
71 throw new ezcBasePropertyNotFoundException( $property );
72 }
73 }
74
78 protected $attribute;
79 }
80 ?>
ezpContentField
Definition: field.php:18
ezpContentField\__call
__call( $method, $arguments)
Definition: field.php:48
ezpContentField\__construct
__construct()
Definition: field.php:19
ezpContentField\__toString
__toString()
Definition: field.php:40
ezpContentField\fromContentObjectAttribute
static fromContentObjectAttribute(eZContentObjectAttribute $attribute)
Definition: field.php:29
ezpContentField\__get
__get( $property)
Definition: field.php:56
ezpContentField\$attribute
$attribute
Definition: field.php:78
$field
$field
Definition: listtable.php:41
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.