class DomainSourceElementManager in Domain Access 8
Checks the access status of entities based on domain settings.
Hierarchy
- class \Drupal\domain\DomainElementManager implements DomainElementManagerInterface uses StringTranslationTrait
- class \Drupal\domain_source\DomainSourceElementManager implements DomainSourceElementManagerInterface
Expanded class hierarchy of DomainSourceElementManager
1 string reference to 'DomainSourceElementManager'
- domain_source.services.yml in domain_source/
domain_source.services.yml - domain_source/domain_source.services.yml
1 service uses DomainSourceElementManager
File
- domain_source/
src/ DomainSourceElementManager.php, line 12
Namespace
Drupal\domain_sourceView source
class DomainSourceElementManager extends DomainElementManager implements DomainSourceElementManagerInterface {
/**
* {@inheritdoc}
*/
public function disallowedOptions(FormStateInterface $form_state, array $field) {
$options = [];
$info = $form_state
->getBuildInfo();
$entity = $form_state
->getFormObject()
->getEntity();
$entity_values = $entity
->get(DomainSourceElementManagerInterface::DOMAIN_SOURCE_FIELD)
->offsetGet(0);
if (isset($field['widget']['#options']) && !empty($entity_values)) {
$value = $entity_values
->getValue('target_id');
$options = array_diff_key(array_flip($value), $field['widget']['#options']);
}
return array_keys($options);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DomainElementManager:: |
protected | property | The domain storage. | |
DomainElementManager:: |
protected | property | The entity type manager. | |
DomainElementManager:: |
public | function |
Stores a static list of fields that have been disallowed. Overrides DomainElementManagerInterface:: |
|
DomainElementManager:: |
public | function |
Gets the domain entity reference field values from an entity. Overrides DomainElementManagerInterface:: |
|
DomainElementManager:: |
public | function |
Returns the default submit handler to be used for a field element. Overrides DomainElementManagerInterface:: |
|
DomainElementManager:: |
public | function | Lists the disallowed domains in the user interface. | |
DomainElementManager:: |
public | function |
Resets form options and stores hidden values that the user cannot change. Overrides DomainElementManagerInterface:: |
|
DomainElementManager:: |
public static | function |
Submit function for handling hidden values from a form. Overrides DomainElementManagerInterface:: |
|
DomainElementManager:: |
public | function | Constructs a DomainElementManager object. | |
DomainSourceElementManager:: |
public | function |
Finds options not accessible to the current user. Overrides DomainElementManager:: |
|
DomainSourceElementManagerInterface:: |
constant | Defines the name of the source domain field. | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |