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

parseYamlForObject() protected method

Attempt to find the object type definition in the schema and create its object representation.
protected parseYamlForObject ( array $schema, string $schemaName, string $objectType ) : LdapObjectSchema
$schema array
$schemaName string
$objectType string
return LdapTools\Schema\LdapObjectSchema
    protected function parseYamlForObject(array $schema, $schemaName, $objectType)
    {
        $objectSchema = $this->getObjectFromSchema($schema, $objectType);
        $objectSchema = $this->mergeAnyExtendedSchemas($objectSchema, $schemaName);
        $objectSchema = $this->cleanObjectArray($objectSchema);
        $this->updateObjectArray($schemaName, $objectSchema);
        $ldapObjectSchema = new LdapObjectSchema($schemaName, $objectSchema['type']);
        foreach ($this->optionMap as $option => $setter) {
            if (array_key_exists($option, $objectSchema)) {
                $ldapObjectSchema->{$setter}($objectSchema[$option]);
            }
        }
        $ldapObjectSchema->setFilter($this->parseFilter($ldapObjectSchema, $objectSchema));
        $ldapObjectSchema->setAttributeMap(isset($objectSchema['attributes']) ? $objectSchema['attributes'] : []);
        $ldapObjectSchema->setConverterMap($this->parseConverterMap($objectSchema));
        $ldapObjectSchema->setControls(...$this->parseControls($objectSchema));
        $this->validateObjectSchema($ldapObjectSchema);
        return $ldapObjectSchema;
    }