* @license PHP License * @package WB * @subpackage db */ /** * Simple datasource decorator * * @version 0.1.1 * @package WB * @subpackage db */ abstract class WBDatasource_Decorator extends WBStdClass { /** * decorator's parameter list * * Concrete classes fill these with default paremeter * @var array */ protected $parameter = array(); /** * configure decorator * * Merge default parameters with given one's * @param array $params */ final public function configure($params = array()) { if (!is_array($params)) { $params = array(); } $this->parameter = array_merge($this->parameter, $params); } /** * Start handler * * Things to do at first item * * @param array $item * @return void */ public function onStart(&$item) { } /** * actually decorate list item * * @param array $item * @return void */ abstract public function decorate(&$item); /** * End handler * * Things to do after last item * * @return void */ public function onEnd() { } }