code = $code; } /** * Marqueur de démarrage */ public function start() { $data = array( 'code' => $this->code, 'dateStart' => date('YmdHis'), ); $model = new Application_Model_ExecutionProcessOut(); try { $id = $model->insert($data); } catch(Zend_Db_Exception $e) { return null; } return $id; } /** * Marqueur du nombre d'éléments à traiter * @param int $id * @param int $num */ public function total($id, $num) { $data = array('total' => $num); $model = new Application_Model_ExecutionProcessOut(); try { $result = $model->update($data, 'id='.$id); } catch(Zend_Db_Exception $e) { return false; } return $result; } /** * Marqueur increment * @param int $id * @param int $num * @return boolean|int */ public function increment($id, $num) { $data = array( 'unitExec' => $num, 'updated' => date('YmdHis'), ); $model = new Application_Model_ExecutionProcessOut(); try { $result = $model->update($data, 'id='.$id); } catch(Zend_Db_Exception $e) { return false; } return $result; } /** * Marqueur de fin * @param int $id * @return boolean|int */ public function end($id) { $data = array( 'dateEnd' => date('YmdHis'), ); try { $result = $model->update($data, 'id='.$id); } catch(Zend_Db_Exception $e) { return false; } return $result; } }