+ Add fetchByID method.

This commit is contained in:
tianshujie
2023-08-29 11:21:29 +08:00
parent e7a6b30842
commit 7d35e336b5
+17
View File
@@ -223,6 +223,23 @@ class model extends baseModel
return $menu;
}
/**
* 通过对象ID获取对象信息。
* Get object information by ID.
*
* @param int $objectID
* @param string $moduleName
* @access public
* @return object|bool
*/
public function fetchByID(int $objectID, string $moduleName = ''): object|bool
{
if(empty($moduleName)) $moduleName = $this->getModuleName();
$table = $this->config->objectTables[$moduleName];
return $this->dao->findById($objectID)->from($table)->fetch();
}
/**
* Process status of an object according to its subStatus.
*