pclib  2.3.2
Lightweight PHP framework
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
BaseObject Class Reference

Ancestor of all pclib classes. More...

Inheritance diagram for BaseObject:
App AuthUser Controller Db Debugger TemplateFactory FileStorage GridPager Logger Model Selection Request Router AuthBase ErrorHandler AuthDbStorage LoggerDbStorage TranslatorDbStorage TplParser ValidatorBase Tpl Translator Tree

Public Member Functions

 loadDefaults ($className=null)
 Load default parameters of class $className into object instance.
 
 setProperties (array $defaults)
 Set public properties of object from the array. More...
 
 addEvent ($name, $callback)
 Add event handler to $object->$name property. More...
 
 toArray ()
 Convert object to array. More...
 

Static Public Member Functions

static defaults ()
 Set or retireve default parameters of the object. More...
 

Data Fields

 $onNewInstance
 Occurs when new instance of the class is created. More...
 
 $onMissingMethod
 Occurs when called method does not exist. More...
 
 $serviceLocator
 var function() Return service object when requested with service(). More...
 

Protected Member Functions

 fireEvent ($name, array $args=array())
 Run all event handlers in $object->$name property. More...
 
 service ($service, $default=null)
 Try acquire $service and load it into property $this->$service. More...
 

Detailed Description

Ancestor of all pclib classes.

Features:

Member Function Documentation

addEvent (   $name,
  $callback 
)

Add event handler to $object->$name property.

Parameters
string$nameEvent name e.g. 'onSave'.
callable$callbackEvent handler. (callable type hint is not supported in php 5.3)
static defaults ( )
static

Set or retireve default parameters of the object.

You can set any public attribute of the object. Example: Form::defaults('useXhtml', true); or Form::defaults($options);

Parameters
mixedConfiguration parameter(s).
fireEvent (   $name,
array  $args = array() 
)
protected

Run all event handlers in $object->$name property.

Parameters
string$nameEvent name e.g. 'onSave'.
array$argsEvent arguments.
service (   $service,
  $default = null 
)
protected

Try acquire $service and load it into property $this->$service.

Service is acquired by calling $onLoadService event.

Parameters
string$serviceService name
mixed$defaultDefault value when service is not found
Returns
object Service object
setProperties ( array  $defaults)

Set public properties of object from the array.

Parameters
array$defaultsArray of parameters to be set.
toArray ( )

Convert object to array.

Returns
array Object

Field Documentation

$onMissingMethod

Occurs when called method does not exist.

$onNewInstance

Occurs when new instance of the class is created.

$serviceLocator

var function() Return service object when requested with service().


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