From 0f338b0defafed5cf3d86f5d4bc59255cb98f8ce Mon Sep 17 00:00:00 2001 From: Artem Otliaguzov Date: Tue, 6 Aug 2024 12:43:25 +0200 Subject: [PATCH] fix UpdateEntity.php --- app/Facades/EntityFacade.php | 7 +++++++ app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php | 8 +++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Facades/EntityFacade.php b/app/Facades/EntityFacade.php index e5f256b..368228c 100644 --- a/app/Facades/EntityFacade.php +++ b/app/Facades/EntityFacade.php @@ -4,6 +4,13 @@ use Illuminate\Support\Facades\Facade; +/** + * Class EntityFacade + * + * @method static void saveMetadataToFederationFolder($entity_id, $federation_id) + * @method static void saveEntityMetadataToFolder($entity_id, $folderName) + * @method static void deleteEntityMetadataFromFolder($fileName, $folderName) + */ class EntityFacade extends Facade { protected static function getFacadeAccessor() diff --git a/app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php b/app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php index ccb18dd..d31d900 100644 --- a/app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php +++ b/app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php @@ -2,6 +2,7 @@ namespace App\Traits\DumpFromGit\EntitiesHelp; +use App\Facades\RsTag; use App\Models\Category; use App\Models\Entity; use App\Traits\ValidatorTrait; @@ -27,7 +28,7 @@ private function updateXmlCategories(string $xml_document, int $category_id): st $rootTag = $xPath->query("//*[local-name()='EntityDescriptor']")->item(0); $entityExtensions = $xPath->query('//md:Extensions'); if ($entityExtensions->length === 0) { - $namespaceURI = $dom->documentElement->lookupNamespaceURI('md'); + $dom->documentElement->lookupNamespaceURI('md'); $entityExtensions = $dom->createElementNS($this->mdURI, 'md:Extensions'); $rootTag->insertBefore($entityExtensions, $rootTag->firstChild); } else { @@ -146,10 +147,7 @@ public function updateEntityXml($entity, array $timestampDocumentArray = []): vo if ($entity->type == 'idp') { $isIdp = true; } - - if ($entity->rs) { - $xml_document = $this->createResearchAndScholarshipTag($xml_document, $isIdp); - } + RsTag::update($entity); if (! empty($entity->category_id)) { $xml_document = $this->updateXmlCategories($xml_document, $entity->category_id); }