Rename caption metadata and use preloaded values

This commit is contained in:
Thibaud Fabre
2016-07-02 14:53:40 +02:00
parent 0bc38c9dd2
commit 7141d4c1d5
2 changed files with 7 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ class StoryTransformer extends TransformerAbstract
/**
* @var array
*/
protected $availableIncludes = ['thumbnail', 'metadatas', 'records', 'caption_metadatas'];
protected $availableIncludes = ['thumbnail', 'metadatas', 'records', 'caption'];
/**
* @var array
@@ -77,9 +77,9 @@ class StoryTransformer extends TransformerAbstract
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()