class DataObjectScaffolder implements ManagerMutatorInterface, ScaffolderInterface, ConfigurationApplier

Scaffolds a DataObjectTypeCreator.

Traits

Offers a few helper methods for classes that are DataObject subclass bound.
Extensible

Config options

default_fields array Minimum fields that any type will expose. Useful for implicitly created types, e.g. exposing a has_one.

Methods

string
getDataObjectClass()

No description

DataObject
getDataObjectInstance()

No description

$this
setDataObjectClass(string $class)

Sets the DataObject name

__construct(string $dataObjectClass)

DataObjectScaffold constructor.

string
getTypeName()

Name of graphql type

$this
addFields(array $fieldData)

Adds visible fields, and optional descriptions.

$this
addField(string $field, string $description = null)

No description

$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)

No description

$this
removeFields(array $fields)

No description

ArrayList
getFields()

No description

getOperations()

No description

getNestedQueries()

No description

$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

operation(string $operation)

Find or make an operation.

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

Gets the class ancestry back to DataObject.

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)

No description

addToManager(Manager $manager)

Adds the type to the Manager.

Details

in DataObjectTypeTrait at line 29
string getDataObjectClass()

Return Value

string

in DataObjectTypeTrait at line 52
DataObject getDataObjectInstance()

Return Value

DataObject

in DataObjectTypeTrait at line 65
$this setDataObjectClass(string $class)

Sets the DataObject name

Parameters

string $class

Return Value

$this

in Chainable at line 21
$this setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)

Set parent

Parameters

DataObjectScaffolder|SchemaScaffolder $parent

Return Value

$this

at line 71
__construct(string $dataObjectClass)

DataObjectScaffold constructor.

Parameters

string $dataObjectClass

at line 83
string getTypeName()

Name of graphql type

Return Value

string

at line 100
$this addFields(array $fieldData)

Adds visible fields, and optional descriptions.

Ex: [ 'MyField' => 'Some description', 'MyOtherField' // No description ]

Parameters

array $fieldData

Return Value

$this

at line 123
$this addField(string $field, string $description = null)

Parameters

string $field
string $description

Return Value

$this

at line 135
$this addAllFields(bool $includeHasOne = false)

Adds all db fields, and optionally has_one.

Parameters

bool $includeHasOne

Return Value

$this

at line 150
$this addAllFieldsExcept(array|string $exclusions, bool $includeHasOne = false)

Adds fields against a blacklist.

Parameters

array|string $exclusions
bool $includeHasOne

Return Value

$this

at line 165
$this removeField(string $field)

Parameters

string $field

Return Value

$this

at line 174
$this removeFields(array $fields)

Parameters

array $fields

Return Value

$this

at line 184
ArrayList getFields()

Return Value

ArrayList

at line 192
OperationList getOperations()

Return Value

OperationList

at line 200
OperationList getNestedQueries()

Return Value

OperationList

at line 212
$this setFieldDescription(string $field, string $description)

Sets the description to an existing field.

Parameters

string $field
string $description

Return Value

$this

at line 245
string getFieldDescription(string $field)

Gets the Description property from a field, given a name

Parameters

string $field

Return Value

string

Exceptions

Exception

at line 268
$this removeOperation(string $identifier)

Removes an operation.

Parameters

string $identifier

Return Value

$this

at line 280
$this addAllOperations()

Adds all operations that are registered

Return Value

$this

at line 295
OperationScaffolder operation(string $operation)

Find or make an operation.

Parameters

string $operation

Return Value

OperationScaffolder

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

Parameters

string $fieldName
QueryScaffolder $queryScaffolder

Return Value

OperationScaffolder|ListQueryScaffolder

at line 380
array getDependentClasses()

Gets types for all ancestors of this class that will need to be added.

Return Value

array

at line 394
array getAncestralClasses() deprecated

deprecated 2.0.0..3.0.0 Use StaticSchema::getAncestry($class) instead

Gets the class ancestry back to DataObject.

Return Value

array

at line 406
DataObjectScaffolder cloneTo(DataObjectScaffolder $target)

Clones this scaffolder to another class, copying over only valid fields and operations

Parameters

DataObjectScaffolder $target

Return Value

DataObjectScaffolder

at line 430
applyConfig(array $config)

Applies settings from an array, i.e. YAML

Parameters

array $config

Exceptions

Exception

at line 545
mixed scaffold(Manager $manager)

Parameters

Manager $manager

Return Value

mixed

at line 562
addToManager(Manager $manager)

Adds the type to the Manager.

Parameters

Manager $manager