LdapTools\Schema\Parser\SchemaYamlParser::mergeIncludedSchemas PHP Method

mergeIncludedSchemas() protected method

If the 'include' directive is used, then merge the specified schemas into the current one.
protected mergeIncludedSchemas ( string $schemaName )
$schemaName string
    protected function mergeIncludedSchemas($schemaName)
    {
        $include = ['include' => [], 'include_default' => []];
        foreach (array_keys($include) as $key) {
            if (isset($this->schemas[$this->schemaFolder][$schemaName][$key])) {
                $include[$key] = $this->schemas[$this->schemaFolder][$schemaName][$key];
                $include[$key] = is_array($include[$key]) ? $include[$key] : [$include[$key]];
            }
        }
        foreach ($include['include'] as $schema) {
            $this->parseAll($schema);
            $this->schemas[$this->schemaFolder][$schemaName]['objects'] = array_merge($this->schemas[$this->schemaFolder][$schemaName]['objects'], $this->schemas[$this->schemaFolder][$schema]['objects']);
        }
        $folder = $this->schemaFolder;
        $this->schemaFolder = $this->defaultSchemaFolder;
        foreach ($include['include_default'] as $schema) {
            $this->parseAll($schema);
            $this->schemas[$folder][$schemaName]['objects'] = array_merge($this->schemas[$folder][$schemaName]['objects'], $this->schemas[$this->schemaFolder][$schema]['objects']);
        }
        $this->schemaFolder = $folder;
    }