* Optimize the function executeHooks.

This commit is contained in:
liugang
2019-07-25 13:02:18 +08:00
parent d5e9999636
commit 621f338faa
12 changed files with 79 additions and 86 deletions
+4 -11
View File
@@ -198,24 +198,17 @@ class control extends baseControl
/**
* Execute hooks of a method.
*
* @param string $methodName
* @param int $objectID
* @access public
* @return void
*/
public function executeHooks($methodName, $objectID)
public function executeHooks($objectID)
{
if(!isset($this->config->bizVersion)) return false;
$flowFile = $this->app->getModuleRoot() . 'workflow/model.php';
$actionFile = $this->app->getModuleRoot() . 'workflowaction/model.php';
$hookFile = $this->app->getModuleRoot() . 'workflowhook/model.php';
if(is_file($flowFile) && is_file($actionFile) && is_file($hookFile))
{
$flow = $this->loadModel('workflow')->getByModule($this->moduleName);
$action = $this->loadModel('workflowaction')->getByModuleAndAction($this->moduleName, $this->methodName);
if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
}
$flow = $this->loadModel('workflow')->getByModule($this->moduleName);
$action = $this->loadModel('workflowaction')->getByModuleAndAction($this->moduleName, $this->methodName);
if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID);
}
/**