Skip to content

Commit

Permalink
Check if a listing is an entity or an array
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Aug 16, 2024
1 parent acf2e5f commit 35edf4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Service/DirectoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ private function createDirectoryFromResult(array $result, bool $update = false):
) {
return null;
} else if (count($this->listDirectory(filters: ['catalogId' => $result['catalogId'], 'directory' => $result['directory']])) > 0 && $update === true) {
$id = $this->listDirectory(filters: ['catalogId' => $result['catalogId'], 'directory' => $result['directory']])[0]['id'];
$listing = $this->listDirectory(filters: ['catalogId' => $result['catalogId'], 'directory' => $result['directory']])[0];

if($listing instanceof Listing) {
$listing = $listing->jsonSerialize();
}

$id = $listing['id'];
}

if($this->config->getValueString($this->appName, 'mongoStorage') === '1') {
Expand Down

0 comments on commit 35edf4b

Please sign in to comment.