* @license PHP License * @package WB * @subpackage db */ WBClass::load('WBDatasource_Decorator', 'WBEvent'); /** * Simple datasource decorator: EventTrigger * * @version 0.1.0 * @package WB * @subpackage db */ class WBDatasource_Decorator_EventTrigger extends WBDatasource_Decorator { /** * decorator's parameter list * * Parameters: * - event - named event * * @var array */ protected $parameter = array( 'event' => 'name:of:event', 'msg' => 'Event triggered by datasource decorator' ); /** * Setup column buffers */ public function onStart(&$item) { } /** * Actually decorate list item * * @param array $item * @return void */ public function decorate(&$item) { WBEvent::trigger($this->parameter['event'], $this->parameter['msg'], $item); } }