FlowLabel.php in CMS Content Sync 8
File
modules/cms_content_sync_views/src/Plugin/views/field/FlowLabel.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 FlowLabel 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;
$flow = \Drupal::entityTypeManager()
->getStorage('cms_content_sync_flow')
->load($entity
->get('flow')->value);
if (isset($flow)) {
return $flow
->label();
}
else {
return '';
}
}
}
Classes
Name |
Description |
FlowLabel |
Views Field handler for the flow label. |