public function BrightcoveVideo::setThumbnail in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::setThumbnail()
- 3.x src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::setThumbnail()
Sets the video's thumbnail image.
Parameters
array|null $thumbnail: The thumbnail image which needs to be saved on the entity.
Return value
\Drupal\brightcove\BrightcoveVideoInterface The called Brightcove Video.
Overrides BrightcoveVideoInterface::setThumbnail
File
- src/
Entity/ BrightcoveVideo.php, line 491
Class
- BrightcoveVideo
- Defines the Brightcove Video entity.
Namespace
Drupal\brightcove\EntityCode
public function setThumbnail($thumbnail) {
// Handle image deletion here as well.
$thumbnail_to_delete = $this
->getThumbnail();
if (is_null($thumbnail) && !empty($thumbnail_to_delete['target_id'])) {
$this
->deleteFile($thumbnail_to_delete['target_id']);
}
$this
->set('thumbnail', $thumbnail);
return $this;
}