mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
Rename caption metadata and use preloaded values
This commit is contained in:
@@ -1102,6 +1102,7 @@ class V1Controller extends Controller
|
|||||||
'results.stories' => $storyTransformer,
|
'results.stories' => $storyTransformer,
|
||||||
'results.stories.thumbnail' => $subdefTransformer,
|
'results.stories.thumbnail' => $subdefTransformer,
|
||||||
'results.stories.metadatas' => new CallbackTransformer(),
|
'results.stories.metadatas' => new CallbackTransformer(),
|
||||||
|
'results.stories.caption' => new CallbackTransformer(),
|
||||||
'results.stories.records' => $recordTransformer,
|
'results.stories.records' => $recordTransformer,
|
||||||
'results.stories.records.thumbnail' => $subdefTransformer,
|
'results.stories.records.thumbnail' => $subdefTransformer,
|
||||||
'results.stories.records.technical_informations' => $technicalDataTransformer,
|
'results.stories.records.technical_informations' => $technicalDataTransformer,
|
||||||
@@ -1244,7 +1245,8 @@ class V1Controller extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('results.stories.metadatas', $includes, true)) {
|
if (in_array('results.stories.metadatas', $includes, true) ||
|
||||||
|
in_array('results.stories.caption', $includes, true)) {
|
||||||
$captions = $this->app['service.caption']->findByReferenceCollection($stories);
|
$captions = $this->app['service.caption']->findByReferenceCollection($stories);
|
||||||
$canSeeBusiness = $this->retrieveSeeBusinessPerDatabox($stories);
|
$canSeeBusiness = $this->retrieveSeeBusinessPerDatabox($stories);
|
||||||
|
|
||||||
@@ -1421,7 +1423,7 @@ class V1Controller extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$includes[] = 'results.stories.caption_metadata';
|
$includes[] = 'results.stories.caption';
|
||||||
}
|
}
|
||||||
|
|
||||||
$includes = array_merge($includes, [
|
$includes = array_merge($includes, [
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class StoryTransformer extends TransformerAbstract
|
|||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $availableIncludes = ['thumbnail', 'metadatas', 'records', 'caption_metadatas'];
|
protected $availableIncludes = ['thumbnail', 'metadatas', 'records', 'caption'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
@@ -77,9 +77,9 @@ class StoryTransformer extends TransformerAbstract
|
|||||||
return $this->collection($storyView->getChildren(), $this->recordTransformer);
|
return $this->collection($storyView->getChildren(), $this->recordTransformer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function includeCaptionMetadatas(StoryView $storyView)
|
public function includeCaption(StoryView $storyView)
|
||||||
{
|
{
|
||||||
return $this->collection($storyView->getStory()->get_caption()->get_fields(), $this->getCaptionRecordTransformer());
|
return $this->collection($storyView->getCaption()->getFields(), $this->getCaptionRecordTransformer());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCaptionRecordTransformer()
|
private function getCaptionRecordTransformer()
|
||||||
|
|||||||
Reference in New Issue
Block a user