PHP Класс MetaAction

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$m_defined boolean True if an action was set up; this member is set to false by the base class. The specialized class must set it to true.
$m_error PEAR_Error Stores the error data
$m_name string Stores the action type name
$m_properties array Action properties

Открытые методы

Метод Описание
CreateAction ( array $p_input ) : MetaAction Factory method; creates an object specialized from MetaAction based on the given input.
DefaultAction ( )
DeleteActionsFromCache ( )
ReadAvailableActions ( ) : array Searches for classes that process actions. Returns an array of action names.
TranslateProperty ( string $p_property ) : string Converts the property name to the standard way of naming properties.
ValidateInput ( array $p_input, string $p_fieldName, integer $p_minSize = null, mixed &$p_error, string $p_errorMessage, mixed $p_errorCode ) : boolean Returns true and sets the error to null if the input field was defined and it's size respected the minimum size constraint. Returns false and initializes the error to a pear error object with the given error message and code if the input field was not defined or did not respect the minimum size constraint. The minimum size constraint may be null.
__construct ( $p_name = 'default' ) Base initializations
__get ( string $p_property ) : mixed Returns the value of the given property; throws InvalidPropertyHandlerException if the property didn't exist.
__set ( string $p_property, mixed $p_value ) Throws InvalidFunctionException; action properties can not be modified.
__unset ( string $p_property ) Throws InvalidFunctionException; action properties can not be modified.
defined ( ) : boolean Returns true if an action was set up.
takeAction ( CampContext &$p_context ) : boolean Performs the action; returns true on success, false on error.

Защищенные методы

Метод Описание
getError ( ) : mixed Returns the error code of the action. Returns 0 on success, PEAR_Error object on error.
trigger_invalid_property_error ( string $p_property, mixed $p_smarty = null ) Registers an error message in the CampTemplate singleton object.

Приватные методы

Метод Описание
FetchActionsFromCache ( )
StoreActionsInCache ( )

Описание методов

CreateAction() публичный статический Метод

Factory method; creates an object specialized from MetaAction based on the given input.
public static CreateAction ( array $p_input ) : MetaAction
$p_input array
Результат MetaAction

DefaultAction() публичный статический Метод

public static DefaultAction ( )

DeleteActionsFromCache() публичный статический Метод

public static DeleteActionsFromCache ( )

ReadAvailableActions() публичный статический Метод

Searches for classes that process actions. Returns an array of action names.
public static ReadAvailableActions ( ) : array
Результат array

TranslateProperty() публичный статический Метод

Converts the property name to the standard way of naming properties.
public static TranslateProperty ( string $p_property ) : string
$p_property string
Результат string

ValidateInput() публичный статический Метод

Returns true and sets the error to null if the input field was defined and it's size respected the minimum size constraint. Returns false and initializes the error to a pear error object with the given error message and code if the input field was not defined or did not respect the minimum size constraint. The minimum size constraint may be null.
public static ValidateInput ( array $p_input, string $p_fieldName, integer $p_minSize = null, mixed &$p_error, string $p_errorMessage, mixed $p_errorCode ) : boolean
$p_input array
$p_fieldName string
$p_minSize integer
$p_error mixed
$p_errorMessage string
$p_errorCode mixed
Результат boolean

__construct() публичный Метод

Base initializations
public __construct ( $p_name = 'default' )

__get() публичный Метод

Returns the value of the given property; throws InvalidPropertyHandlerException if the property didn't exist.
public __get ( string $p_property ) : mixed
$p_property string
Результат mixed

__set() закрытый публичный Метод

Throws InvalidFunctionException; action properties can not be modified.
final public __set ( string $p_property, mixed $p_value )
$p_property string
$p_value mixed

__unset() закрытый публичный Метод

Throws InvalidFunctionException; action properties can not be modified.
final public __unset ( string $p_property )
$p_property string

defined() закрытый публичный Метод

Returns true if an action was set up.
final public defined ( ) : boolean
Результат boolean

getError() защищенный Метод

Returns the error code of the action. Returns 0 on success, PEAR_Error object on error.
protected getError ( ) : mixed
Результат mixed

takeAction() публичный Метод

Performs the action; returns true on success, false on error.
public takeAction ( CampContext &$p_context ) : boolean
$p_context CampContext - the current context object
Результат boolean

trigger_invalid_property_error() защищенный Метод

Registers an error message in the CampTemplate singleton object.
protected trigger_invalid_property_error ( string $p_property, mixed $p_smarty = null )
$p_property string
$p_smarty mixed

Описание свойств

$m_defined защищенное свойство

True if an action was set up; this member is set to false by the base class. The specialized class must set it to true.
protected bool $m_defined
Результат boolean

$m_error защищенное свойство

Stores the error data
protected PEAR_Error $m_error
Результат PEAR_Error

$m_name защищенное свойство

Stores the action type name
protected string $m_name
Результат string

$m_properties защищенное свойство

Action properties
protected array $m_properties
Результат array