PHP Class Prado\Util\TBehavior

Since: 3.2.3
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TComponent, implements Prado\Util\IBehavior
Show file Open project: pradosoft/prado

Public Methods

Method Description
attach ( $owner ) Attaches the behavior object to the component.
detach ( $owner ) Detaches the behavior object from the component.
events ( ) : array Declares events and the corresponding event handler methods.
getEnabled ( ) : boolean
getOwner ( ) : TComponent
setEnabled ( $value )

Method Details

attach() public method

The default implementation will set the {@link owner} property and attach event handlers as declared in {@link events}. Make sure you call the parent implementation if you override this method.
public attach ( $owner )

detach() public method

The default implementation will unset the {@link owner} property and detach event handlers declared in {@link events}. Make sure you call the parent implementation if you override this method.
public detach ( $owner )

events() public method

The events are defined by the {@link owner} component, while the handler methods by the behavior class. The handlers will be attached to the corresponding events when the behavior is attached to the {@link owner} component; and they will be detached from the events when the behavior is detached from the component.
public events ( ) : array
return array events (array keys) and the corresponding event handler methods (array values).

getEnabled() public method

public getEnabled ( ) : boolean
return boolean whether this behavior is enabled

getOwner() public method

public getOwner ( ) : TComponent
return TComponent the owner component that this behavior is attached to.

setEnabled() public method

public setEnabled ( $value )