PoolLabel.php in CMS Content Sync 2.0.x
File
modules/cms_content_sync_views/src/Plugin/views/field/PoolLabel.php
View source
<?php
namespace Drupal\cms_content_sync_views\Plugin\views\field;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
class PoolLabel extends FieldPluginBase {
public function query() {
}
protected function defineOptions() {
$options = parent::defineOptions();
return $options;
}
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
}
public function render(ResultRow $values) {
$entity = $values->_entity;
$pool = \Drupal::entityTypeManager()
->getStorage('cms_content_sync_pool')
->load($entity
->get('pool')->value);
if (isset($pool)) {
return $pool
->label();
}
else {
return '';
}
}
}
Classes
Name |
Description |
PoolLabel |
Views Field handler for the pool label. |