BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
ParamProcessor\ParamDefinitionFactory Class Reference

Public Member Functions

 registerGlobals ()
 
 registerType ($type, array $data)
 
 getComponentForType ($paramType, $componentType)
 
 newDefinitionFromArray (array $param, $getMad=true)
 

Static Public Member Functions

static singleton ()
 

Detailed Description

Factory for IParamDefinition implementing objects.

GNU GPL v2+

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Member Function Documentation

ParamProcessor\ParamDefinitionFactory::getComponentForType (   $paramType,
  $componentType 
)

Returns the specified component for the provided parameter type. This method is likely to change in the future in a compat breaking way.

Since
1.0
Parameters
string$paramType
string$componentType
Exceptions
Exception
Returns
mixed
ParamProcessor\ParamDefinitionFactory::newDefinitionFromArray ( array  $param,
  $getMad = true 
)

Construct a new ParamDefinition from an array.

Since
1.0
Parameters
array$param
bool$getMad
Returns
IParamDefinition|false
Exceptions
Exception
ParamProcessor\ParamDefinitionFactory::registerGlobals ( )

Registers the parameter types specified in the global $wgParamDefinitions.

Since
1.0
ParamProcessor\ParamDefinitionFactory::registerType (   $type,
array  $data 
)

Registers a parameter type.

The type is specified as a string identifier for the type, ie 'boolean', and an array containing further data. This data currently includes:

  • string-parser: the parser to use to transform string values This class needs to implement ValueParser. Default: NullParser
  • typed-parser: the parser to use to transform typed PHP values This class needs to implement ValueParser. Default: NullParser
  • validator: the validation object to use This class needs to implement ValueValidator. Default: NullValidator
  • validation-callback a callback to use for validation, called before the ValueValidator This callback needs to return a boolean indicating validity.
Since
1.0
Parameters
string$type
array$data
Returns
boolean Indicates if the type was registered
static ParamProcessor\ParamDefinitionFactory::singleton ( )
static

Singleton.

Since
1.0
Deprecated:
since 1.0
Returns
ParamDefinitionFactory

The documentation for this class was generated from the following file: