protected function getDefinitionWithReplacements($base_plugin_id, array
$replacements,
$exception_on_invalid = TRUE
) { $definitions =
$this->
getDefinitions();
$type =
$this->
determineType($base_plugin_id,
$definitions);
$definition =
$definitions[$type];
// Check whether this type is an extension of another one and compile it.
if (isset($definition['type'
])) { $merge =
$this->
getDefinition($definition['type'
],
$exception_on_invalid);
// Preserve integer keys on merge, so sequence item types can override
// parent settings as opposed to adding unused second, third, etc. items.
$definition = NestedArray::
mergeDeepArray([$merge,
$definition], TRUE
);
// Replace dynamic portions of the definition type.
if (!
empty($replacements) &&
strpos($definition['type'
], ']'
)) { $sub_type =
$this->
determineType($this->
replaceName($definition['type'
],
$replacements),
$definitions);