Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpattributeoperatorformatter.php
Go to the documentation of this file.
1 <?php
12 class ezpAttributeOperatorFormatter
13 {
20 protected function getType( $item )
21 {
22 $type = gettype( $item );
23 if ( is_object( $item ) )
24 $type .= "[" . get_class( $item ) . "]";
25
26 return $type;
27 }
28
35 protected function getValue( $item )
36 {
37 if ( is_bool( $item ) )
38 $value = $item ? "true" : "false";
39 else if ( is_array( $item ) )
40 $value = 'Array(' . count( $item ) . ')';
41 else if ( is_numeric( $item ) )
42 $value = $item;
43 else if ( is_string( $item ) )
44 $value = "'" . $item . "'";
45 else if ( is_object( $item ) )
46 $value = method_exists( $item, '__toString' ) ? (string)$item : 'Object';
47 else
48 $value = $item;
49
50 return $value;
51 }
52
56 public function exportScalar( $value )
57 {
58 return var_export( $value, true );
59 }
60 }
$item
$item
Definition: classes/admin/linklist.php:228
$type
$type
Definition: classes/admin/linkselect.php:220
ezpAttributeOperatorFormatter
Definition: ezpattributeoperatorformatter.php:13
ezpAttributeOperatorFormatter\exportScalar
exportScalar( $value)
Definition: ezpattributeoperatorformatter.php:56
ezpAttributeOperatorFormatter\getValue
getValue( $item)
Definition: ezpattributeoperatorformatter.php:35
ezpAttributeOperatorFormatter\getType
getType( $item)
Definition: ezpattributeoperatorformatter.php:20
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.