Skip to content

Commit

Permalink
Merge pull request #96 from alchemy-fr/PARADE-900-fix-facet-and-fields
Browse files Browse the repository at this point in the history
PARADE-900 fix facet and fields
  • Loading branch information
xrousset78800 authored Jul 11, 2024
2 parents 0168d73 + 8c62b87 commit b513739
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PhraseanetSDK/ApplicationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface ApplicationInterface
/**
* @var string SDK version
*/
const VERSION = '0.9.x';
const VERSION = '0.10.x';

/**
* Return an OAuth2Connector
Expand Down
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 b513739

Please sign in to comment.