PHP Class LdapTools\Schema\Parser\SchemaYamlParser

Author: Chad Sikorra ([email protected])
Inheritance: implements LdapTools\Schema\Parser\SchemaParserInterface
Afficher le fichier Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Свойство Type Description
$arrayToOp LdapTools\Utilities\ArrayToOperator
$defaultSchemaFolder The folder where the default schema files reside.
$optionMap array
$schemaFolder The folder where the schema files are located.
$schemas Schema names to their YAML mappings (ie. ['ad' => [ ]])

Méthodes publiques

Méthode Description
__construct ( string $schemaFolder )
getSchemaModificationTime ( string $schemaName ) : DateTime Given the schema name, return the last time the schema was modified in DateTime format.
parse ( $schemaName, $objectType )
parseAll ( $schemaName )

Méthodes protégées

Méthode Description
cleanObjectArray ( array $schemaObject ) : array Removes certain keys so they don't get parsed again.
getExtendedDefaultSchemaObject ( array $objectSchema ) : array If we need to retrieve one of the default schemas, then it's probably the case that the schema folder path was manually defined. So retrieve the default schema object by parsing the name from the default folder path and then reset the schema folder back to what it originally was.
getObjectFromSchema ( array $schema, string $objectType ) : array Check for a specific object type in the schema and validate it.
getParentSchemaObject ( array $objectSchema, string $schemaName ) : array Determines what parent array object to get based on the directive used.
getSchemaFileName ( string $folder, string $schema ) : string Check for a YML file of the specified schema name and return the full path.
mergeAnyExtendedSchemas ( array $objectSchema, string $schemaName ) : array If the 'extends' option is given, then merge this schema object with the requested schema object.
mergeDefaultSchemaFile ( string $schemaName ) If the 'extends_default' directive is used, then merge the specified default schema.
mergeIncludedSchemas ( string $schemaName ) If the 'include' directive is used, then merge the specified schemas into the current one.
mergeSchemaObjectArrays ( array $parent, array $schema ) : array Performs the logic for merging one schema object array with another.
parseControls ( array $objectSchema ) : LdapControl[]
parseConverterMap ( array $objectSchema ) : array Parse the converters section of an object schema definition to generate the attribute converter map.
parseFilter ( LdapObjectSchema $objectSchema, array $objectArray ) : BaseOperator Get the filter for the schema object.
parseSchemaNameToArray ( string $schemaName ) Given a schema name, parse it into the array.
parseYamlForObject ( array $schema, string $schemaName, string $objectType ) : LdapObjectSchema Attempt to find the object type definition in the schema and create its object representation.
updateObjectArray ( string $schemaName, array $schemaObject ) Update the object in the schema array in case it extended a different object type.
validateObjectSchema ( LdapObjectSchema $schema ) Validate that an object schema meets the minimum requirements.
validateSchemaType ( LdapObjectSchema $schema, array $schemaArray ) Validates some of the schema values to check that they are allowed.

Method Details

__construct() public méthode

public __construct ( string $schemaFolder )
$schemaFolder string

cleanObjectArray() protected méthode

Removes certain keys so they don't get parsed again.
protected cleanObjectArray ( array $schemaObject ) : array
$schemaObject array
Résultat array

getExtendedDefaultSchemaObject() protected méthode

If we need to retrieve one of the default schemas, then it's probably the case that the schema folder path was manually defined. So retrieve the default schema object by parsing the name from the default folder path and then reset the schema folder back to what it originally was.
protected getExtendedDefaultSchemaObject ( array $objectSchema ) : array
$objectSchema array
Résultat array

getObjectFromSchema() protected méthode

Check for a specific object type in the schema and validate it.
protected getObjectFromSchema ( array $schema, string $objectType ) : array
$schema array
$objectType string
Résultat array

getParentSchemaObject() protected méthode

Determines what parent array object to get based on the directive used.
protected getParentSchemaObject ( array $objectSchema, string $schemaName ) : array
$objectSchema array
$schemaName string
Résultat array

getSchemaFileName() protected méthode

Check for a YML file of the specified schema name and return the full path.
protected getSchemaFileName ( string $folder, string $schema ) : string
$folder string
$schema string
Résultat string

getSchemaModificationTime() public méthode

Given the schema name, return the last time the schema was modified in DateTime format.
public getSchemaModificationTime ( string $schemaName ) : DateTime
$schemaName string
Résultat DateTime

mergeAnyExtendedSchemas() protected méthode

If the 'extends' option is given, then merge this schema object with the requested schema object.
protected mergeAnyExtendedSchemas ( array $objectSchema, string $schemaName ) : array
$objectSchema array
$schemaName string
Résultat array

mergeDefaultSchemaFile() protected méthode

If the 'extends_default' directive is used, then merge the specified default schema.
protected mergeDefaultSchemaFile ( string $schemaName )
$schemaName string

mergeIncludedSchemas() protected méthode

If the 'include' directive is used, then merge the specified schemas into the current one.
protected mergeIncludedSchemas ( string $schemaName )
$schemaName string

mergeSchemaObjectArrays() protected méthode

Performs the logic for merging one schema object array with another.
protected mergeSchemaObjectArrays ( array $parent, array $schema ) : array
$parent array The parent schema object being extended.
$schema array The base schema object being defined.
Résultat array

parse() public méthode

public parse ( $schemaName, $objectType )

parseAll() public méthode

public parseAll ( $schemaName )

parseControls() protected méthode

protected parseControls ( array $objectSchema ) : LdapControl[]
$objectSchema array
Résultat LdapTools\Connection\LdapControl[]

parseConverterMap() protected méthode

Parse the converters section of an object schema definition to generate the attribute converter map.
protected parseConverterMap ( array $objectSchema ) : array
$objectSchema array
Résultat array

parseFilter() protected méthode

Get the filter for the schema object.
protected parseFilter ( LdapObjectSchema $objectSchema, array $objectArray ) : BaseOperator
$objectSchema LdapTools\Schema\LdapObjectSchema
$objectArray array
Résultat LdapTools\Query\Operator\BaseOperator

parseSchemaNameToArray() protected méthode

Given a schema name, parse it into the array.
protected parseSchemaNameToArray ( string $schemaName )
$schemaName string

parseYamlForObject() protected méthode

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
Résultat LdapTools\Schema\LdapObjectSchema

updateObjectArray() protected méthode

Update the object in the schema array in case it extended a different object type.
protected updateObjectArray ( string $schemaName, array $schemaObject )
$schemaName string
$schemaObject array

validateObjectSchema() protected méthode

Validate that an object schema meets the minimum requirements.
protected validateObjectSchema ( LdapObjectSchema $schema )
$schema LdapTools\Schema\LdapObjectSchema

validateSchemaType() protected méthode

Validates some of the schema values to check that they are allowed.
protected validateSchemaType ( LdapObjectSchema $schema, array $schemaArray )
$schema LdapTools\Schema\LdapObjectSchema
$schemaArray array

Property Details

$arrayToOp protected_oe property

protected ArrayToOperator,LdapTools\Utilities $arrayToOp
Résultat LdapTools\Utilities\ArrayToOperator

$defaultSchemaFolder protected_oe property

The folder where the default schema files reside.
protected $defaultSchemaFolder

$optionMap protected_oe property

protected array $optionMap
Résultat array

$schemaFolder protected_oe property

The folder where the schema files are located.
protected $schemaFolder

$schemas protected_oe property

Schema names to their YAML mappings (ie. ['ad' => [ ]])
protected $schemas