From e78a8928824850ac2911bf852efc1bb212dd05f2 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 20 Aug 2024 16:03:27 +0600 Subject: [PATCH] pkp/pkp-lib#10292 Controlled vocab dao to eloquent model --- classes/ArticleFront.php | 17 ++++++++--------- tests/functional/ArticleTest.php | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/classes/ArticleFront.php b/classes/ArticleFront.php index 1e2ed67..09eeff9 100644 --- a/classes/ArticleFront.php +++ b/classes/ArticleFront.php @@ -12,19 +12,19 @@ namespace APP\plugins\generic\jatsTemplate\classes; -use APP\core\Application; -use APP\facades\Repo; use APP\issue\Issue; +use APP\facades\Repo; +use PKP\core\PKPString; use APP\journal\Journal; use APP\section\Section; -use APP\submission\Submission; -use APP\publication\Publication; +use PKP\core\PKPRequest; +use APP\core\Application; use PKP\core\PKPApplication; -use PKP\core\PKPString; -use PKP\db\DAORegistry; +use APP\submission\Submission; use PKP\plugins\PluginRegistry; +use APP\publication\Publication; use PKP\submissionFile\SubmissionFile; -use PKP\core\PKPRequest; +use PKP\submission\SubmissionKeywordVocab; class ArticleFront extends \DOMDocument { @@ -284,8 +284,7 @@ function createArticleMeta(Submission $submission, Journal $journal, Section $se ->appendChild($this->createElement('self-uri')) ->setAttribute('xlink:href', $url); - $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); - foreach ($submissionKeywordDao->getKeywords($publication->getId(), $journal->getSupportedSubmissionLocales()) as $locale => $keywords) { + foreach (SubmissionKeywordVocab::getKeywords($publication->getId(), $journal->getSupportedSubmissionLocales()) as $locale => $keywords) { if (empty($keywords)) continue; $kwdGroupElement = $articleMetaElement diff --git a/tests/functional/ArticleTest.php b/tests/functional/ArticleTest.php index f5acd09..b1fcb7b 100644 --- a/tests/functional/ArticleTest.php +++ b/tests/functional/ArticleTest.php @@ -36,7 +36,7 @@ class ArticleTest extends PKPTestCase */ protected function getMockedDAOs(): array { - return [...parent::getMockedDAOs(), 'OAIDAO', 'SubmissionSubjectDAO', 'SubmissionKeywordDAO']; + return [...parent::getMockedDAOs(), 'OAIDAO']; } /**