Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpattributeoperatormanager.php
Go to the documentation of this file.
1 <?php
12 class ezpAttributeOperatorManager
13 {
17 protected static $formatter = null;
18 protected static $format = null;
19
27 protected static function createFormatter( $format )
28 {
29 $formatterOptions = new ezpExtensionOptions();
30 $formatterOptions->iniFile = 'template.ini';
31 $formatterOptions->iniSection = 'AttributeOperator';
32 $formatterOptions->iniVariable = 'OutputFormatter';
33 $formatterOptions->handlerIndex = $format;
34
35 $formatterInstance = eZExtension::getHandlerClass( $formatterOptions );
36
37 if ( !( $formatterInstance instanceof ezpAttributeOperatorFormatterInterface ) )
38 eZDebug::writeError( "Undefined output formatter for '{$format}'", __METHOD__ );
39
40 return $formatterInstance;
41 }
42
50 protected static function isRegisteredFormatter( $format )
51 {
52 return array_key_exists( $format, eZINI::instance( 'template.ini' )->variableArray( 'AttributeOperator', 'OutputFormatter' ) );
53 }
54
62 public static function getOutputFormatter( $format )
63 {
64 if ( !self::isRegisteredFormatter( $format ) )
65 {
66 $format = eZINI::instance( 'template.ini' )->variable( 'AttributeOperator', 'DefaultFormatter' );
67 }
68
69 if ( !( self::$formatter instanceof ezpAttributeOperatorFormatterInterface ) || $format != self::$format )
70 {
71 self::$formatter = self::createFormatter( $format );
72 self::$format = $format;
73 }
74
75 return self::$formatter;
76 }
77 }
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:546
eZExtension\getHandlerClass
static getHandlerClass(ezpExtensionOptions $options)
Definition: ezextension.php:480
ezpAttributeOperatorManager
Definition: ezpattributeoperatormanager.php:13
ezpAttributeOperatorManager\$format
static $format
Definition: ezpattributeoperatormanager.php:18
ezpAttributeOperatorManager\getOutputFormatter
static getOutputFormatter( $format)
Definition: ezpattributeoperatormanager.php:62
ezpAttributeOperatorManager\createFormatter
static createFormatter( $format)
Definition: ezpattributeoperatormanager.php:27
ezpAttributeOperatorManager\$formatter
static $formatter
Definition: ezpattributeoperatormanager.php:17
ezpAttributeOperatorManager\isRegisteredFormatter
static isRegisteredFormatter( $format)
Definition: ezpattributeoperatormanager.php:50
ezpExtensionOptions
Definition: ezpextensionoptions.php:59
ezpAttributeOperatorFormatterInterface
Definition: ezpattributeoperatorformatterinterface.php:13
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.