View source
<?php
namespace Drupal\views\Plugin\views\field;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Field\FieldTypePluginManagerInterface;
use Drupal\Core\Field\FormatterPluginManager;
use Drupal\Core\Form\FormHelper;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\PluginDependencyTrait;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Render\Element;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Entity\Render\EntityFieldRenderer;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\DependentWithRemovalPluginInterface;
use Drupal\views\ResultRow;
use Drupal\views\ViewExecutable;
use Symfony\Component\DependencyInjection\ContainerInterface;
class EntityField extends FieldPluginBase implements CacheableDependencyInterface, MultiItemsFieldHandlerInterface, DependentWithRemovalPluginInterface {
use FieldAPIHandlerTrait;
use PluginDependencyTrait;
public $items = [];
public $multiple;
public $limit_values;
public $base_table;
protected $formatterOptions;
protected $entityTypeManager;
protected $entityRepository;
protected $formatterPluginManager;
protected $languageManager;
protected $renderer;
protected $fieldTypePluginManager;
protected $entityFieldRenderer;
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, FormatterPluginManager $formatter_plugin_manager, FieldTypePluginManagerInterface $field_type_plugin_manager, LanguageManagerInterface $language_manager, RendererInterface $renderer, EntityRepositoryInterface $entity_repository, EntityFieldManagerInterface $entity_field_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
$this->formatterPluginManager = $formatter_plugin_manager;
$this->fieldTypePluginManager = $field_type_plugin_manager;
$this->languageManager = $language_manager;
$this->renderer = $renderer;
$this->entityRepository = $entity_repository;
$this->entityFieldManager = $entity_field_manager;
if (isset($this->definition['entity field'])) {
$this->definition['field_name'] = $this->definition['entity field'];
}
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'), $container
->get('plugin.manager.field.formatter'), $container
->get('plugin.manager.field.field_type'), $container
->get('language_manager'), $container
->get('renderer'), $container
->get('entity.repository'), $container
->get('entity_field.manager'));
}
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->multiple = FALSE;
$this->limit_values = FALSE;
$field_definition = $this
->getFieldDefinition();
$cardinality = $field_definition
->getFieldStorageDefinition()
->getCardinality();
if ($field_definition
->getFieldStorageDefinition()
->isMultiple()) {
$this->multiple = TRUE;
if (!$this->options['group_rows']) {
$this->limit_values = TRUE;
}
if (!empty($this->options['delta_first_last'])) {
$this->limit_values = TRUE;
}
if ($this->options['delta_limit'] > 0 && $this->options['delta_limit'] != $cardinality || intval($this->options['delta_offset'])) {
$this->limit_values = TRUE;
}
}
}
public function access(AccountInterface $account) {
$access_control_handler = $this->entityTypeManager
->getAccessControlHandler($this
->getEntityType());
return $access_control_handler
->fieldAccess('view', $this
->getFieldDefinition(), $account);
}
public function query($use_groupby = FALSE) {
$fields = $this->additional_fields;
$entity_type_key = array_search('entity_type', $fields);
if ($entity_type_key !== FALSE) {
unset($fields[$entity_type_key]);
}
if ($use_groupby) {
$options = [];
if ($this->options['group_column'] != 'entity_id') {
$options = [
$this->options['group_column'] => $this->options['group_column'],
];
}
$options += is_array($this->options['group_columns']) ? $this->options['group_columns'] : [];
$fields = [];
$table_mapping = $this
->getTableMapping();
$field_definition = $this
->getFieldStorageDefinition();
foreach ($options as $column) {
$fields[$column] = $table_mapping
->getFieldColumnName($field_definition, $column);
}
$this->group_fields = $fields;
}
if ($this
->add_field_table($use_groupby)) {
$this
->ensureMyTable();
$this
->addAdditionalFields($fields);
}
$this
->getEntityFieldRenderer()
->query($this->query, $this->relationship);
}
public function add_field_table($use_groupby) {
if ($use_groupby) {
return TRUE;
}
if ($this->multiple && !$this->options['group_rows']) {
return TRUE;
}
return FALSE;
}
public function clickSortable() {
if ($this->multiple && $this->options['group_rows']) {
return FALSE;
}
if (isset($this->definition['click sortable'])) {
return (bool) $this->definition['click sortable'];
}
return TRUE;
}
public function clickSort($order) {
if (empty($this->options['click_sort_column'])) {
return;
}
$this
->ensureMyTable();
$field_storage_definition = $this
->getFieldStorageDefinition();
$column = $this
->getTableMapping()
->getFieldColumnName($field_storage_definition, $this->options['click_sort_column']);
if (!isset($this->aliases[$column])) {
$this->aliases[$column] = $this->tableAlias . '.' . $column;
if (!empty($this->view
->getQuery()->options['distinct'])) {
$this->query
->addField($this->tableAlias, $column);
}
}
$this->query
->addOrderBy(NULL, NULL, $order, $this->aliases[$column]);
}
protected function getFieldStorageDefinition() {
$entity_type_id = $this->definition['entity_type'];
$field_storage_definitions = $this->entityFieldManager
->getFieldStorageDefinitions($entity_type_id);
if (isset($this->definition['field_name']) && isset($field_storage_definitions[$this->definition['field_name']])) {
return $field_storage_definitions[$this->definition['field_name']];
}
if (isset($this->definition['entity field']) && isset($field_storage_definitions[$this->definition['entity field']])) {
return $field_storage_definitions[$this->definition['entity field']];
}
$base_fields = $this->entityFieldManager
->getBaseFieldDefinitions($entity_type_id);
if (isset($this->definition['field_name']) && isset($base_fields[$this->definition['field_name']])) {
return $base_fields[$this->definition['field_name']]
->getFieldStorageDefinition();
}
}
protected function defineOptions() {
$options = parent::defineOptions();
$field_storage_definition = $this
->getFieldStorageDefinition();
$field_type = $this->fieldTypePluginManager
->getDefinition($field_storage_definition
->getType());
$column_names = array_keys($field_storage_definition
->getColumns());
$default_column = '';
if (count($column_names) == 1) {
$default_column = $column_names[0];
}
elseif (in_array('value', $column_names)) {
$default_column = 'value';
}
$options['click_sort_column'] = [
'default' => $default_column,
];
if (isset($this->definition['default_formatter'])) {
$options['type'] = [
'default' => $this->definition['default_formatter'],
];
}
elseif (isset($field_type['default_formatter'])) {
$options['type'] = [
'default' => $field_type['default_formatter'],
];
}
else {
$options['type'] = [
'default' => '',
];
}
$options['settings'] = [
'default' => isset($this->definition['default_formatter_settings']) ? $this->definition['default_formatter_settings'] : [],
];
$options['group_column'] = [
'default' => $default_column,
];
$options['group_columns'] = [
'default' => [],
];
$options['group_rows'] = [
'default' => TRUE,
];
$options['delta_limit'] = [
'default' => $field_storage_definition
->getCardinality() > 1 ? $field_storage_definition
->getCardinality() : 0,
];
$options['delta_offset'] = [
'default' => 0,
];
$options['delta_reversed'] = [
'default' => FALSE,
];
$options['delta_first_last'] = [
'default' => FALSE,
];
$options['multi_type'] = [
'default' => 'separator',
];
$options['separator'] = [
'default' => ', ',
];
$options['field_api_classes'] = [
'default' => FALSE,
];
return $options;
}
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$field = $this
->getFieldDefinition();
$formatters = $this->formatterPluginManager
->getOptions($field
->getType());
$column_names = array_keys($field
->getColumns());
if ($this->multiple) {
$this
->multiple_options_form($form, $form_state);
}
if (count($field
->getColumns()) == 1) {
$form['click_sort_column'] = [
'#type' => 'value',
'#value' => isset($column_names[0]) ? $column_names[0] : '',
];
}
else {
$form['click_sort_column'] = [
'#type' => 'select',
'#title' => $this
->t('Column used for click sorting'),
'#options' => array_combine($column_names, $column_names),
'#default_value' => $this->options['click_sort_column'],
'#description' => $this
->t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'),
];
}
$form['type'] = [
'#type' => 'select',
'#title' => $this
->t('Formatter'),
'#options' => $formatters,
'#default_value' => $this->options['type'],
'#ajax' => [
'url' => views_ui_build_form_url($form_state),
],
'#submit' => [
[
$this,
'submitTemporaryForm',
],
],
'#executes_submit_callback' => TRUE,
];
$form['field_api_classes'] = [
'#title' => $this
->t('Use field template'),
'#type' => 'checkbox',
'#default_value' => $this->options['field_api_classes'],
'#description' => $this
->t('If checked, field api classes will be added by field templates. This is not recommended unless your CSS depends upon these classes. If not checked, template will not be used.'),
'#fieldset' => 'style_settings',
'#weight' => 20,
];
if ($this->multiple) {
$form['field_api_classes']['#description'] .= ' ' . $this
->t('Checking this option will cause the group Display Type and Separator values to be ignored.');
}
$settings_form = [
'#value' => [],
];
$format = isset($form_state
->getUserInput()['options']['type']) ? $form_state
->getUserInput()['options']['type'] : $this->options['type'];
if ($formatter = $this
->getFormatterInstance($format)) {
$settings_form = $formatter
->settingsForm($form, $form_state);
FormHelper::rewriteStatesSelector($settings_form, "fields[{$field->getName()}][settings_edit_form]", 'options');
}
$form['settings'] = $settings_form;
}
public function submitFormCalculateOptions(array $options, array $form_state_options) {
unset($options['settings']);
$options = $form_state_options + $options;
if (!isset($options['settings'])) {
$options['settings'] = [];
}
return $options;
}
public function multiple_options_form(&$form, FormStateInterface $form_state) {
$field = $this
->getFieldDefinition();
$form['multiple_field_settings'] = [
'#type' => 'details',
'#title' => $this
->t('Multiple field settings'),
'#weight' => 5,
];
$form['group_rows'] = [
'#title' => $this
->t('Display all values in the same row'),
'#type' => 'checkbox',
'#default_value' => $this->options['group_rows'],
'#description' => $this
->t('If checked, multiple values for this field will be shown in the same row. If not checked, each value in this field will create a new row. If using group by, please make sure to group by "Entity ID" for this setting to have any effect.'),
'#fieldset' => 'multiple_field_settings',
];
list($prefix, $suffix) = explode('@count', $this
->t('Display @count value(s)'));
if ($field
->getCardinality() == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) {
$type = 'textfield';
$options = NULL;
$size = 5;
}
else {
$type = 'select';
$range = range(1, $field
->getCardinality());
$options = array_combine($range, $range);
$size = 1;
}
$form['multi_type'] = [
'#type' => 'radios',
'#title' => $this
->t('Display type'),
'#options' => [
'ul' => $this
->t('Unordered list'),
'ol' => $this
->t('Ordered list'),
'separator' => $this
->t('Simple separator'),
],
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
],
],
'#default_value' => $this->options['multi_type'],
'#fieldset' => 'multiple_field_settings',
];
$form['separator'] = [
'#type' => 'textfield',
'#title' => $this
->t('Separator'),
'#default_value' => $this->options['separator'],
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
':input[name="options[multi_type]"]' => [
'value' => 'separator',
],
],
],
'#fieldset' => 'multiple_field_settings',
];
$form['delta_limit'] = [
'#type' => $type,
'#size' => $size,
'#field_prefix' => $prefix,
'#field_suffix' => $suffix,
'#options' => $options,
'#default_value' => $this->options['delta_limit'],
'#prefix' => '<div class="container-inline">',
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
],
],
'#fieldset' => 'multiple_field_settings',
];
list($prefix, $suffix) = explode('@count', $this
->t('starting from @count'));
$form['delta_offset'] = [
'#type' => 'textfield',
'#size' => 5,
'#field_prefix' => $prefix,
'#field_suffix' => $suffix,
'#default_value' => $this->options['delta_offset'],
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
],
],
'#description' => $this
->t('(first item is 0)'),
'#fieldset' => 'multiple_field_settings',
];
$form['delta_reversed'] = [
'#title' => $this
->t('Reversed'),
'#type' => 'checkbox',
'#default_value' => $this->options['delta_reversed'],
'#suffix' => $suffix,
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
],
],
'#description' => $this
->t('(start from last values)'),
'#fieldset' => 'multiple_field_settings',
];
$form['delta_first_last'] = [
'#title' => $this
->t('First and last only'),
'#type' => 'checkbox',
'#default_value' => $this->options['delta_first_last'],
'#suffix' => '</div>',
'#states' => [
'visible' => [
':input[name="options[group_rows]"]' => [
'checked' => TRUE,
],
],
],
'#fieldset' => 'multiple_field_settings',
];
}
public function buildGroupByForm(&$form, FormStateInterface $form_state) {
parent::buildGroupByForm($form, $form_state);
$field_columns = array_keys($this
->getFieldDefinition()
->getColumns());
$group_columns = [
'entity_id' => $this
->t('Entity ID'),
] + array_map('ucfirst', array_combine($field_columns, $field_columns));
$form['group_column'] = [
'#type' => 'select',
'#title' => $this
->t('Group column'),
'#default_value' => $this->options['group_column'],
'#description' => $this
->t('Select the column of this field to apply the grouping function selected above.'),
'#options' => $group_columns,
];
$options = [
'bundle' => 'Bundle',
'language' => 'Language',
'entity_type' => 'Entity_type',
];
$form['group_columns'] = [
'#type' => 'checkboxes',
'#title' => $this
->t('Group columns (additional)'),
'#default_value' => $this->options['group_columns'],
'#description' => $this
->t('Select any additional columns of this field to include in the query and to group on.'),
'#options' => $options + $group_columns,
];
}
public function submitGroupByForm(&$form, FormStateInterface $form_state) {
parent::submitGroupByForm($form, $form_state);
$item =& $form_state
->get('handler')->options;
$item['group_column'] = $form_state
->getValue([
'options',
'group_column',
]);
$item['group_columns'] = array_filter($form_state
->getValue([
'options',
'group_columns',
]));
}
public function renderItems($items) {
if (!empty($items)) {
if ($this->options['multi_type'] == 'separator' || !$this->options['group_rows']) {
$separator = $this->options['multi_type'] == 'separator' ? Xss::filterAdmin($this->options['separator']) : '';
$build = [
'#type' => 'inline_template',
'#template' => '{{ items | safe_join(separator) }}',
'#context' => [
'separator' => $separator,
'items' => $items,
],
];
}
else {
$build = [
'#theme' => 'item_list',
'#items' => $items,
'#title' => NULL,
'#list_type' => $this->options['multi_type'],
];
}
return $this->renderer
->render($build);
}
}
protected function prepareItemsByDelta(array $all_values) {
if ($this->options['delta_reversed']) {
$all_values = array_reverse($all_values);
}
if ($this->limit_values) {
$row = $this->view->result[$this->view->row_index];
if (!$this->options['group_rows'] && isset($this->aliases['delta']) && isset($row->{$this->aliases['delta']})) {
$delta_limit = 1;
$offset = $row->{$this->aliases['delta']};
}
elseif (!$this->options['group_rows'] && !$this->multiple) {
$delta_limit = 1;
$offset = 0;
}
else {
$delta_limit = $this->options['delta_limit'];
$offset = intval($this->options['delta_offset']);
if ($delta_limit === 0) {
$delta_limit = count($all_values) - $offset;
}
}
$delta_first_last = $this->options['delta_first_last'];
$new_values = [];
for ($i = 0; $i < $delta_limit; $i++) {
$new_delta = $offset + $i;
if (isset($all_values[$new_delta])) {
if (!$delta_first_last || $new_delta == $offset || $new_delta == $delta_limit + $offset - 1) {
$new_values[] = $all_values[$new_delta];
}
}
}
$all_values = $new_values;
}
return $all_values;
}
public function preRender(&$values) {
parent::preRender($values);
$this
->getEntityFieldRenderer()
->preRender($values);
}
protected function getEntityFieldRenderer() {
if (!isset($this->entityFieldRenderer)) {
if (!empty($this->view->field)) {
foreach ($this->view->field as $field) {
if ($field->relationship == $this->relationship && isset($field->entityFieldRenderer)) {
$this->entityFieldRenderer = $field->entityFieldRenderer;
break;
}
}
}
if (!isset($this->entityFieldRenderer)) {
$entity_type = $this->entityTypeManager
->getDefinition($this
->getEntityType());
$this->entityFieldRenderer = new EntityFieldRenderer($this->view, $this->relationship, $this->languageManager, $entity_type, $this->entityTypeManager, $this->entityRepository);
}
}
return $this->entityFieldRenderer;
}
public function getItems(ResultRow $values) {
if (!$this->displayHandler
->useGroupBy()) {
$build_list = $this
->getEntityFieldRenderer()
->render($values, $this);
}
else {
$display = [
'type' => $this->options['type'],
'settings' => $this->options['settings'],
'label' => 'hidden',
];
if ($entity = $this
->getEntity($values)) {
$entity = $this
->createEntityForGroupBy($entity, $values);
$build_list = isset($entity->{$this->definition['field_name']}) ? $entity->{$this->definition['field_name']}
->view($display) : NULL;
}
else {
$build_list = NULL;
}
}
if (!$build_list) {
return [];
}
if ($this->options['field_api_classes']) {
return [
[
'rendered' => $this->renderer
->render($build_list),
],
];
}
$items = [];
$bubbleable = BubbleableMetadata::createFromRenderArray($build_list);
foreach (Element::children($build_list) as $delta) {
BubbleableMetadata::createFromRenderArray($build_list[$delta])
->merge($bubbleable)
->applyTo($build_list[$delta]);
$items[$delta] = [
'rendered' => $build_list[$delta],
'raw' => $build_list['#items'][$delta],
];
}
return $this
->prepareItemsByDelta($items);
}
protected function createEntityForGroupBy(EntityInterface $entity, ResultRow $row) {
$processed_entity = clone $this
->getEntityFieldRenderer()
->getEntityTranslation($entity, $row);
if (!empty($this->group_fields) && isset($entity->{$this->definition['field_name']})) {
$base_value = [];
$data = FALSE;
foreach ($this->group_fields as $field_name => $column) {
if (property_exists($row, $this->aliases[$column])) {
$base_value[$field_name] = $row->{$this->aliases[$column]};
if (isset($base_value[$field_name])) {
$data = TRUE;
}
}
}
if ($data) {
$processed_entity->{$this->definition['field_name']} = [
$base_value,
];
}
else {
$processed_entity->{$this->definition['field_name']} = [];
}
}
return $processed_entity;
}
public function render_item($count, $item) {
return $this->renderer
->render($item['rendered']);
}
protected function documentSelfTokens(&$tokens) {
$field = $this
->getFieldDefinition();
foreach ($field
->getColumns() as $id => $column) {
$tokens['{{ ' . $this->options['id'] . '__' . $id . ' }}'] = $this
->t('Raw @column', [
'@column' => $id,
]);
}
}
protected function addSelfTokens(&$tokens, $item) {
$field = $this
->getFieldDefinition();
foreach ($field
->getColumns() as $id => $column) {
if (isset($item['raw'])) {
$raw = $item['raw'];
if (is_array($raw)) {
if (isset($raw[$id]) && is_scalar($raw[$id])) {
$tokens['{{ ' . $this->options['id'] . '__' . $id . ' }}'] = Xss::filterAdmin($raw[$id]);
}
else {
$tokens['{{ ' . $this->options['id'] . '__' . $id . ' }}'] = '';
}
}
if (is_object($raw)) {
$property = $raw
->get($id);
if (!empty($property) && $property instanceof TypedDataInterface) {
$tokens['{{ ' . $this->options['id'] . '__' . $id . ' }}'] = Xss::filterAdmin($property
->getString());
}
else {
$tokens['{{ ' . $this->options['id'] . '__' . $id . ' }}'] = '';
}
}
}
}
}
protected function getFormatterInstance($format = NULL) {
if (!isset($format)) {
$format = $this->options['type'];
}
$settings = $this->options['settings'] + $this->formatterPluginManager
->getDefaultSettings($format);
$options = [
'field_definition' => $this
->getFieldDefinition(),
'configuration' => [
'type' => $format,
'settings' => $settings,
'label' => '',
'weight' => 0,
],
'view_mode' => '_custom',
];
return $this->formatterPluginManager
->getInstance($options);
}
public function calculateDependencies() {
$this->dependencies = parent::calculateDependencies();
if (($field_storage_definition = $this
->getFieldStorageDefinition()) && $field_storage_definition instanceof EntityInterface) {
$this->dependencies['config'][] = $field_storage_definition
->getConfigDependencyName();
}
if (!empty($this->options['type'])) {
$this->dependencies['module'][] = $this->formatterPluginManager
->getDefinition($this->options['type'])['provider'];
if (($formatter = $this
->getFormatterInstance()) && $formatter instanceof DependentPluginInterface) {
$this
->calculatePluginDependencies($formatter);
}
}
return $this->dependencies;
}
public function getCacheMaxAge() {
return Cache::PERMANENT;
}
public function getCacheContexts() {
return $this
->getEntityFieldRenderer()
->getCacheContexts();
}
public function getCacheTags() {
$field_definition = $this
->getFieldDefinition();
$field_storage_definition = $this
->getFieldStorageDefinition();
return Cache::mergeTags($field_definition instanceof CacheableDependencyInterface ? $field_definition
->getCacheTags() : [], $field_storage_definition instanceof CacheableDependencyInterface ? $field_storage_definition
->getCacheTags() : []);
}
protected function getTableMapping() {
return $this->entityTypeManager
->getStorage($this->definition['entity_type'])
->getTableMapping();
}
public function getValue(ResultRow $values, $field = NULL) {
$entity = $this
->getEntity($values);
if ($entity === NULL) {
return NULL;
}
$translated_entity = $this
->getEntityFieldRenderer()
->getEntityTranslation($entity, $values);
$field_item_list = isset($translated_entity->{$this->definition['field_name']}) ? $translated_entity->{$this->definition['field_name']} : NULL;
if (!isset($field_item_list)) {
return NULL;
}
$field_item_definition = $field_item_list
->getFieldDefinition();
$values = [];
foreach ($field_item_list as $field_item) {
if ($field) {
$values[] = $field_item->{$field};
}
elseif ($main_property_name = $field_item
->mainPropertyName()) {
$values[] = $field_item->{$main_property_name};
}
else {
$values[] = $field_item->value;
}
}
if ($field_item_definition
->getFieldStorageDefinition()
->getCardinality() == 1) {
return reset($values);
}
else {
return $values;
}
}
public function onDependencyRemoval(array $dependencies) {
$remove = FALSE;
$current_dependencies = $this
->calculateDependencies();
foreach ($current_dependencies as $group => $dependency_list) {
foreach ($dependency_list as $config_key) {
if (isset($dependencies[$group]) && array_key_exists($config_key, $dependencies[$group])) {
$remove = TRUE;
break 2;
}
}
}
return $remove;
}
}