BrightcoveVideoPlaylistCmsEntity.php in Brightcove Video Connect 3.x
File
src/Entity/BrightcoveVideoPlaylistCmsEntity.php
View source
<?php
namespace Drupal\brightcove\Entity;
use Drupal\brightcove\BrightcoveVideoPlaylistCMSEntityInterface;
abstract class BrightcoveVideoPlaylistCmsEntity extends BrightcoveCmsEntity implements BrightcoveVideoPlaylistCMSEntityInterface {
public function getPlayer() {
return $this
->get('player')->target_id;
}
public function setPlayer($player) {
return $this
->set('player', $player);
}
public function getReferenceId() {
return $this
->get('reference_id')->value;
}
public function setReferenceId($reference_id) {
return $this
->set('reference_id', $reference_id);
}
public static function getDefaultReferenceId() {
return [
'drupal:' . \Drupal::CORE_COMPATIBILITY . ":" . \Drupal::currentUser()
->id() . ":" . md5(microtime()),
];
}
public function getTags() {
return $this
->get('tags')
->getValue();
}
public function setTags(array $tags) {
$this
->set('tags', $tags);
return $this;
}
public function isPublished() {
return (bool) $this
->getEntityKey('status');
}
public function setPublished($published) {
return $this
->set('status', $published ? NODE_PUBLISHED : NODE_NOT_PUBLISHED);
}
}