Пример #1
0
 /**
  * This method processes the models and returns the status.
  *
  * @access public
  * @static
  * @param BT\Task $task                                     the task to do the processing
  * @param BT\Exchange $exchange                             the exchange given to process
  * @return integer                                          the status code
  */
 public static function process(BT\Task $task, BT\Exchange $exchange)
 {
     $task->before();
     try {
         $status = $task->process($exchange);
     } catch (\Exception $ex) {
         $status = BT\Task\Status::ERROR;
     }
     $task->after();
     return $status;
 }
Пример #2
0
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->tasks);
 }