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
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
Gets the uninherited value for the given config option
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
in Configurable at line 20
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
....).
in Configurable at line 32
mixed
stat(string $name)
deprecated
deprecated 5.0 Use ->config()->get() instead
Get inherited config value
in Configurable at line 44
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
in Configurable at line 57
$this
set_stat(string $name, mixed $value)
deprecated
deprecated 5.0 Use ->config()->set() instead
Update the config value for a given property
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.