diff --git a/src/PhraseanetSDK/ApplicationInterface.php b/src/PhraseanetSDK/ApplicationInterface.php index d0f5bc5..1967a02 100644 --- a/src/PhraseanetSDK/ApplicationInterface.php +++ b/src/PhraseanetSDK/ApplicationInterface.php @@ -26,7 +26,7 @@ interface ApplicationInterface /** * @var string SDK version */ - const VERSION = '0.9.x'; + const VERSION = '0.10.x'; /** * Return an OAuth2Connector diff --git a/src/PhraseanetSDK/Entity/Record.php b/src/PhraseanetSDK/Entity/Record.php index a928528..c99f3fb 100644 --- a/src/PhraseanetSDK/Entity/Record.php +++ b/src/PhraseanetSDK/Entity/Record.php @@ -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)); diff --git a/src/PhraseanetSDK/Entity/Story.php b/src/PhraseanetSDK/Entity/Story.php index ca3a838..87e8f61 100644 --- a/src/PhraseanetSDK/Entity/Story.php +++ b/src/PhraseanetSDK/Entity/Story.php @@ -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( diff --git a/src/PhraseanetSDK/Repository/Record.php b/src/PhraseanetSDK/Repository/Record.php index 935add4..5467927 100644 --- a/src/PhraseanetSDK/Repository/Record.php +++ b/src/PhraseanetSDK/Repository/Record.php @@ -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 diff --git a/src/PhraseanetSDK/Repository/Story.php b/src/PhraseanetSDK/Repository/Story.php index c43774e..90cd6f6 100644 --- a/src/PhraseanetSDK/Repository/Story.php +++ b/src/PhraseanetSDK/Repository/Story.php @@ -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);