id; } /** * {@inheritdoc} */ public function getPluginCollections() { return [ 'type_configuration' => $this->typePluginCollection(), ]; } /** * {@inheritdoc} */ public static function getLabel(MediaInterface $media) { $bundle = static::load($media->bundle()); return $bundle ? $bundle->label() : FALSE; } /** * {@inheritdoc} */ public static function exists($id) { return (bool) static::load($id); } /** * {@inheritdoc} */ public function getDescription() { return $this->description; } /** * {@inheritdoc} */ public function setDescription($description) { $this->description = $description; return $this; } /** * {@inheritdoc} */ public function getTypeConfiguration() { return $this->type_configuration; } /** * {@inheritdoc} */ public function setTypeConfiguration($configuration) { $this->type_configuration = $configuration; $this->typePluginCollection = NULL; } /** * {@inheritdoc} */ public function getQueueThumbnailDownloads() { return $this->queue_thumbnail_downloads; } /** * {@inheritdoc} */ public function setQueueThumbnailDownloads($queue_thumbnail_downloads) { $this->queue_thumbnail_downloads = $queue_thumbnail_downloads; } /** * {@inheritdoc} */ public function getType() { return $this->typePluginCollection()->get($this->type); } /** * Returns type lazy plugin collection. * * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection * The tag plugin collection. */ protected function typePluginCollection() { if (!$this->typePluginCollection) { $this->typePluginCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.media_entity.type'), $this->type, $this->type_configuration); } return $this->typePluginCollection; } /** * {@inheritdoc} */ public function getStatus() { return $this->status; } /** * {@inheritdoc} */ public function shouldCreateNewRevision() { return $this->new_revision; } /** * {@inheritdoc} */ public function setNewRevision($new_revision) { $this->new_revision = $new_revision; } }