Skip to content

Commit

Permalink
fix facets and fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Jul 11, 2024
1 parent 0952dac commit 8c62b87
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/PhraseanetSDK/Entity/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ public function getCaption()
public function getMetadata()
{
if (! isset($this->source->metadata)) {
$this->metadata = new ArrayCollection();
// fallback on caption source
$this->metadata = $this->getCaption();
}

return $this->metadata ?: new ArrayCollection(Metadata::fromList($this->source->metadata));
Expand Down
3 changes: 2 additions & 1 deletion src/PhraseanetSDK/Entity/Story.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ public function getRecords()
public function getMetadata()
{
if (! isset($this->source->metadata)) {
$this->metadata = new ArrayCollection();
// fallback on caption source
$this->metadata = $this->getCaption();
}

return $this->metadata ?: $this->metadata = new ArrayCollection(
Expand Down
1 change: 1 addition & 0 deletions src/PhraseanetSDK/Repository/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function search(array $parameters = array(), $pAPINumber = 1)
}

$results->results->stories = [];
$results->facets = $res->facets;
$results->count = $res->count;
$results->total = $res->total;
$results->limit = isset($res->limit) ? $res->limit : 10; // TODO: just $res->limit after a phraseanet PR in searchraw
Expand Down
1 change: 1 addition & 0 deletions src/PhraseanetSDK/Repository/Story.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function search(array $parameters = array(), $pAPINumber = 1)
}

$results->results->records = [];
$results->facets = $res->facets;
}

return Query::fromValue($this->em, $results);
Expand Down

0 comments on commit 8c62b87

Please sign in to comment.