* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler' , 'WBEvent_Handler_ITS'); /** * Event_Handler_Stop * * Stop event processing accoding to ticket status * * @version 0.1.0 * @package WB * @subpackage base */ class WBEvent_Handler_ITS_Stop extends WBEvent_Handler_ITS { /** * handler config * * Parameters: * - "status": List of status to stop * - "loadticket": index of id to load ticket * * @var array */ protected $config = array( 'status' => array('new', 'closed', 'trash'), 'loadticket' => '' ); /** * process event * * Stop processing if status is one on config * * @see isRecoverable() * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $this->loadTicket($e); $status = $e->get('status'); if (in_array($status, $this->config['status'])) { return false; } return true; } }