function Mapping::getRequiredKeys

Same name in other branches
  1. 10 core/lib/Drupal/Core/Config/Schema/Mapping.php \Drupal\Core\Config\Schema\Mapping::getRequiredKeys()

Gets all required keys in this mapping.

Return value

string[] A list of keys required in this mapping.

1 call to Mapping::getRequiredKeys()
Mapping::getOptionalKeys in core/lib/Drupal/Core/Config/Schema/Mapping.php
Gets all optional keys in this mapping.

File

core/lib/Drupal/Core/Config/Schema/Mapping.php, line 72

Class

Mapping
Defines a mapping configuration element.

Namespace

Drupal\Core\Config\Schema

Code

public function getRequiredKeys() : array {
    $all_keys = $this->getDefinedKeys();
    $required_keys = array_filter($all_keys, fn(array $schema_definition): bool => $schema_definition['requiredKey']);
    return array_keys($required_keys);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.