From 5bc22eb2da43450b44c764e13baae8503caa80e9 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 27 Dec 2023 14:34:59 +0800 Subject: [PATCH] - Remove unused methods for solution. --- module/solution/model.php | 54 ------------------------- module/solution/test/solution.class.php | 7 ++++ 2 files changed, 7 insertions(+), 54 deletions(-) diff --git a/module/solution/model.php b/module/solution/model.php index 39c79c1d2a..25fc84abdd 100644 --- a/module/solution/model.php +++ b/module/solution/model.php @@ -31,39 +31,6 @@ class solutionModel extends model return $solution; } - /** - * 根据名称获取解决方案。 - * Get solution by name. - * - * @param string $keyword - * @access public - * @return array - */ - public function search(string $keyword = ''): array - { - return $this->dao->select('*')->from(TABLE_SOLUTION) - ->where('deleted')->eq(0) - ->beginIF($keyword)->andWhere('name')->like($keyword)->fi() - ->orderBy('createdAt desc') - ->fetchAll(); - } - - /** - * 更新解决方案名称。 - * Update solution name. - * - * @param int $solutionID - * @access public - * @return bool - */ - public function updateName(int $solutionID): bool - { - $newSolution = fixer::input('post')->trim('name')->get(); - $this->dao->update(TABLE_SOLUTION)->data($newSolution)->autoCheck()->where('id')->eq($solutionID)->exec(); - - return !dao::isError(); - } - /** * 根据应用市场的解决方案创建本地解决方案。 * Create by solution of cloud market. @@ -477,27 +444,6 @@ class solutionModel extends model return !dao::isError(); } - /** - * 转化方案的配置信息为选择项的参数。 - * Convert schema choices to select options. - * - * @param array $schemaChoices - * @param object $cloudSolution - * @access public - * @return array - */ - public function createSelectOptions(array $schemaChoices, object $cloudSolution): array - { - $options = array(); - foreach($schemaChoices as $cloudApp) - { - $appInfo = zget($cloudSolution->apps, $cloudApp->name, array()); - $options[$cloudApp->name] = zget($appInfo, 'alias', $cloudApp->name); - } - - return $options; - } - /** * 保存安装日志。 * Save message to error log file. diff --git a/module/solution/test/solution.class.php b/module/solution/test/solution.class.php index c064a7cd51..5ffa17377c 100644 --- a/module/solution/test/solution.class.php +++ b/module/solution/test/solution.class.php @@ -19,6 +19,13 @@ class solutionTest $this->objectModel = $tester->loadModel('solution'); } + /** + * Test getByID method. + * + * @param int $solutionID + * @access public + * @return object|null + */ public function getByIdTest(int $solutionID): object|null { return $this->objectModel->getByID($solutionID);