Skip to content

Commit

Permalink
fix UpdateEntity.php
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Aug 6, 2024
1 parent 8b5f38d commit 0f338b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 7 additions & 0 deletions app/Facades/EntityFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 3 additions & 5 deletions app/Traits/DumpFromGit/EntitiesHelp/UpdateEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f338b0

Please sign in to comment.