DataObjectScaffolder
class DataObjectScaffolder implements ManagerMutatorInterface, ScaffolderInterface, ConfigurationApplier (View source)
Scaffolds a DataObjectTypeCreator.
Traits
Offers a few helper methods for classes that are DataObject subclass bound.
Properties
static private array | $default_fields | 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
string
getDataObjectClass()
DataObject
getDataObjectInstance()
$this
setDataObjectClass(string $class)
Sets the DataObject name
$this
setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)
Set parent
__construct(string $dataObjectClass)
DataObjectScaffold constructor.
string
getTypeName()
Name of graphql type
$this
addFields(array $fieldData)
Adds visible fields, and optional descriptions.
Ex: [ 'MyField' => 'Some description', 'MyOtherField' // No description ]
$this
addField(string $field, string $description = null)
$this
addAllFields(bool $includeHasOne = false)
Adds all db fields, and optionally has_one.
$this
addAllFieldsExcept(array|string $exclusions, bool $includeHasOne = false)
Adds fields against a blacklist.
$this
removeField(string $field)
$this
removeFields(array $fields)
ArrayList
getFields()
OperationList
getOperations()
OperationList
getNestedQueries()
$this
setFieldDescription(string $field, string $description)
Sets the description to an existing field.
string
getFieldDescription(string $field)
Gets the Description property from a field, given a name
$this
removeOperation(string $identifier)
Removes an operation.
$this
addAllOperations()
Adds all operations that are registered
OperationScaffolder
operation(string $operation)
Find or make an operation.
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
array
getDependentClasses()
Gets types for all ancestors of this class that will need to be added.
array
getAncestralClasses()
deprecated
deprecated
Gets the class ancestry back to DataObject.
DataObjectScaffolder
cloneTo(DataObjectScaffolder $target)
Clones this scaffolder to another class, copying over only valid fields and operations
applyConfig(array $config)
Applies settings from an array, i.e. YAML
mixed
scaffold(Manager $manager)
addToManager(Manager $manager)
Adds the type to the Manager.