* @license PHP License * @package WB * @subpackage Event_Handler */ WBClass::load('WBEvent_Handler' , 'WBEvent_Handler_Dictionary'); /** * Event_Handler_DictionaryAutopopulate * * Populate dictionary record using each dictionaries auto-populate feature * * @version 0.1.1 * @package WB * @subpackage Event_Handler */ class WBEvent_Handler_DictionaryAutopopulate extends WBEvent_Handler_Dictionary { /** * Process event * * Populate dictionary record * * @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->dict = WBClass::create('WBDictionary_' . $e->get('dictionary')); if (!$this->dict) { return false; } $this->dict->load($e->get('id')); $id = $this->dict->getId(); if (empty($id)) { return false; } $this->dict->autoPopulate(); return true; } }