php-dextrin

DXNSchemaProvider

Lets a class's *own* library ship a DXN schema for it -- field names, types, required/optional, closed/forbidden, refinements -- without that library ever taking a runtime dependency on this one.

The struct (schema-backed) counterpart to what Registry::putTagEncoder() already does for simple scalar-wrapping custom-tag values: an extension point owned by the consuming application, not forced onto every class-defining library it might want to use with dextrin.

Implement DXNSchemaMaterializingProvider instead of this interface directly when the schema's decoded field map should become something nicer than a bare field array -- an interface split, rather than an optional method the way the JS port's own duck-typed dxnMaterialize? is, since PHP interfaces can't declare an optional method.

Table of Contents

Methods

dxnClass()  : class-string
The PHP class {@see self::dxnSchemaName()}'s schema is associated with, for `{form: 'reference', name}` checks during encode-time validation.
dxnSchema()  : string
This provider's own `.dxns` source -- every named type and every `%schema{}` entry it defines gets compiled in, not only {@see self::dxnSchemaName()}'s own entry.
dxnSchemaName()  : string
Which `%schema{}` entry in {@see self::dxnSchema()}'s own document this provider is for.

Methods

dxnClass()

The PHP class {@see self::dxnSchemaName()}'s schema is associated with, for `{form: 'reference', name}` checks during encode-time validation.

public dxnClass() : class-string
Return values
class-string

dxnSchema()

This provider's own `.dxns` source -- every named type and every `%schema{}` entry it defines gets compiled in, not only {@see self::dxnSchemaName()}'s own entry.

public dxnSchema() : string
Return values
string

dxnSchemaName()

Which `%schema{}` entry in {@see self::dxnSchema()}'s own document this provider is for.

public dxnSchemaName() : string
Return values
string
On this page

Search results