public function Section::getItems in Workbench Access 8
Items should be stored in the result array, if possible, as an array with 'value' as the actual displayable value of the item, plus any items that might be found in the 'alter' options array for creating links, such as 'path', 'fragment', 'query' etc, such a thing is to be made. Additionally, items that might be turned into tokens should also be in this array.
Overrides PrerenderList::getItems
1 method overrides Section::getItems()
- UserSection::getItems in src/
Plugin/ views/ field/ UserSection.php - Items should be stored in the result array, if possible, as an array with 'value' as the actual displayable value of the item, plus any items that might be found in the 'alter' options array for creating links, such as…
File
- src/
Plugin/ views/ field/ Section.php, line 94
Class
- Section
- Field handler to present the section assigned to the node.
Namespace
Drupal\workbench_access\Plugin\views\fieldCode
public function getItems(ResultRow $values) {
$this->items = [];
if ($entity = $this
->getEntity($values)) {
$scheme = $this->scheme
->getAccessScheme();
$sections = $scheme
->getEntityValues($entity);
$tree = $scheme
->getTree();
foreach ($sections as $id) {
foreach ($tree as $root => $data) {
if (isset($data[$id])) {
// Check for link.
if ($this->options['make_link'] && isset($data[$id]['path'])) {
$this->items[$id]['path'] = $data[$id]['path'];
$this->items[$id]['make_link'] = TRUE;
}
$this->items[$id]['value'] = $this
->sanitizeValue($data[$id]['label']);
}
}
}
}
return $this->items;
}