StaticSchema
class StaticSchema
Global map of dataobject classes to graphql schema types.
Provides an automatic scaffold mechanism for any classes without explicit mapping.
This must be done globally and prior to scaffolding as type mapping must be determined before scaffolding begins.
Traits
Constants
PREFER_UNION |
|
PREFER_SINGLE |
|
Config options
inheritanceTypeSuffix | string |
Methods
No description
Removes the current instance
Given a DataObject subclass name, transform it into a sanitised (and implicitly unique) type name suitable for the GraphQL schema
Gets the type name for a union type of all ancestors of a class given the classname
Gets the type name for a union type of all ancestors of a class given the type name
No description
Returns true if the field name can be accessed on the given object
No description
Gets all ancestors of a DataObject
No description
Gets the type from the manager given a DataObject class. Will use an inheritance type if available.
Details
at line 51
static StaticSchema
inst()
at line 63
static
setInstance(StaticSchema $inst = null)
at line 71
static
reset()
Removes the current instance
at line 83
string
typeNameForDataObject(string $class)
Given a DataObject subclass name, transform it into a sanitised (and implicitly unique) type name suitable for the GraphQL schema
at line 101
string
inheritanceTypeNameForDataObject(string $class)
Gets the type name for a union type of all ancestors of a class given the classname
at line 112
string
inheritanceTypeNameForType(string $typeName)
Gets the type name for a union type of all ancestors of a class given the type name
at line 121
mixed
typeName(string $str)
at line 133
bool
isValidFieldName(ViewableData $instance, string $fieldName)
Returns true if the field name can be accessed on the given object
at line 142
$this
setTypeNames(array $typesMap)
at line 180
array
getAncestry(string $dataObjectClass)
Gets all ancestors of a DataObject
at line 203
array
getDescendants(string $dataObjectClass)
at line 227
Type
fetchFromManager(string $class, Manager $manager, int $mode = self::PREFER_UNION)
Gets the type from the manager given a DataObject class. Will use an inheritance type if available.