Ejemplo n.º 1
0
 /**
  * @param int $id
  * @param array $custom_flow
  * @param array $custom_options
  * @return $this|null
  */
 function set_current_flow($id, $custom_flow = null, $custom_options = null)
 {
     if (isset($this->_flow_list[$id])) {
         $this->_current_id = $id;
         $this->_current_flow = $this->_flow_list[$id];
     } else {
         $flow = new Module_FlowManager_Flow();
         $flow->id = $id;
         $get_flow = $flow->get();
         if ($get_flow === false) {
             $this->_current_id = null;
             $this->_current_flow = null;
             return null;
         }
         $this->_current_id = $id;
         $this->_current_flow = $flow;
     }
     $this->custom_flow($custom_flow);
     $this->custom_options($custom_options);
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param int $flow_id
  * @return array
  */
 private static function _get_fields_by_flow_id($flow_id)
 {
     $flow = new Module_FlowManager_Flow();
     $flow->id = $flow_id;
     $flow_info = $flow->get();
     if (!$flow_info) {
         return Lib_Helper::get_err_struct(Const_Err_DataAccess::ERR_FLOW_NOT_EXISTS, 'no this flow, flow_id: ' . $flow_id);
     }
     $fields = Module_ModuleManager_InterfaceGen::get_instance()->gen_fields($flow);
     return Lib_Helper::get_return_struct($fields);
 }