+ Add fetchByID method.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user