DataObjectScaffolder
class DataObjectScaffolder implements ManagerMutatorInterface, ScaffolderInterface, ConfigurationApplier
Scaffolds a DataObjectTypeCreator.
Traits
Config options
| default_fields | array | Minimum fields that any type will expose. Useful for implicitly created types, e.g. exposing a has_one. |
Methods
DataObjectScaffold constructor.
Name of graphql type
Adds visible fields, and optional descriptions.
No description
Adds all db fields, and optionally has_one.
Adds fields against a blacklist.
No description
No description
No description
No description
No description
Sets the description to an existing field.
Gets the Description property from a field, given a name
Removes an operation.
Adds all operations that are registered
Find or make an operation.
Finds or adds a nested query, e.g. has_many/many_many relation, or a query created with a custom scaffolder
Gets types for all ancestors of this class that will need to be added.
Clones this scaffolder to another class, copying over only valid fields and operations
Applies settings from an array, i.e. YAML
Details
in DataObjectTypeTrait at line 29
string
getDataObjectClass()
in DataObjectTypeTrait at line 52
DataObject
getDataObjectInstance()
in DataObjectTypeTrait at line 65
$this
setDataObjectClass(string $class)
Sets the DataObject name
in Chainable at line 21
$this
setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)
Set parent
in Chainable at line 31
DataObjectScaffolder|SchemaScaffolder
end()
at line 71
__construct(string $dataObjectClass)
DataObjectScaffold constructor.
at line 83
string
getTypeName()
Name of graphql type
at line 100
$this
addFields(array $fieldData)
Adds visible fields, and optional descriptions.
Ex: [ 'MyField' => 'Some description', 'MyOtherField' // No description ]
at line 123
$this
addField(string $field, string $description = null)
at line 135
$this
addAllFields(bool $includeHasOne = false)
Adds all db fields, and optionally has_one.
at line 150
$this
addAllFieldsExcept(array|string $exclusions, bool $includeHasOne = false)
Adds fields against a blacklist.
at line 165
$this
removeField(string $field)
at line 174
$this
removeFields(array $fields)
at line 184
ArrayList
getFields()
at line 192
OperationList
getOperations()
at line 200
OperationList
getNestedQueries()
at line 212
$this
setFieldDescription(string $field, string $description)
Sets the description to an existing field.
at line 245
string
getFieldDescription(string $field)
Gets the Description property from a field, given a name
at line 268
$this
removeOperation(string $identifier)
Removes an operation.
at line 280
$this
addAllOperations()
Adds all operations that are registered
at line 295
OperationScaffolder
operation(string $operation)
Find or make an operation.
at line 334
OperationScaffolder|ListQueryScaffolder
nestedQuery(string $fieldName, QueryScaffolder $queryScaffolder = null)
Finds or adds a nested query, e.g. has_many/many_many relation, or a query created with a custom scaffolder
at line 380
array
getDependentClasses()
Gets types for all ancestors of this class that will need to be added.
at line 394
array
getAncestralClasses()
deprecated
deprecated
Gets the class ancestry back to DataObject.
at line 406
DataObjectScaffolder
cloneTo(DataObjectScaffolder $target)
Clones this scaffolder to another class, copying over only valid fields and operations
at line 430
applyConfig(array $config)
Applies settings from an array, i.e. YAML
at line 545
mixed
scaffold(Manager $manager)
at line 562
addToManager(Manager $manager)
Adds the type to the Manager.