public function BrightcoveVideo::setRelatedLink in Brightcove Video Connect 8.2
Same name and namespace in other branches
- 8 src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::setRelatedLink()
- 3.x src/Entity/BrightcoveVideo.php \Drupal\brightcove\Entity\BrightcoveVideo::setRelatedLink()
Sets the video's related link.
Parameters
array|null $related_link: The related link.
Return value
\Drupal\brightcove\BrightcoveVideoInterface The called Brightcove Video.
Overrides BrightcoveVideoInterface::setRelatedLink
File
- src/
Entity/ BrightcoveVideo.php, line 348
Class
- BrightcoveVideo
- Defines the Brightcove Video entity.
Namespace
Drupal\brightcove\EntityCode
public function setRelatedLink($related_link) {
// If the protocol is missing from the link add default http protocol to
// the link.
if (!empty($related_link['uri']) && !preg_match('/[\\w-]+:\\/\\//i', $related_link['uri'])) {
$related_link['uri'] = "http://{$related_link['uri']}";
}
$this
->set('related_link', $related_link);
return $this;
}