* Refactor zahostModel::getImageByID, and add its unit test.

This commit is contained in:
liumengyi
2023-12-26 19:13:07 +08:00
parent 400d440e4f
commit bf905a652c
2 changed files with 55 additions and 7 deletions
+6 -7
View File
@@ -570,17 +570,16 @@ class zanodemodel extends model
}
/**
* Get Image.
* 通过 id 获取镜像。
* Get Image by id.
*
* @param int $id
* @param int $id
* @access public
* @return object
* @return object|false
*/
public function getImageByID($id)
public function getImageByID(int $id): object|bool
{
return $this->dao->select('*')->from(TABLE_IMAGE)
->where('id')->eq($id)
->fetch();
return $this->dao->select('*')->from(TABLE_IMAGE)->where('id')->eq($id)->fetch();
}
/**