class Delete extends MutationScaffolder implements OperationResolver, CRUDInterface (View source)

A generic delete operation.

Traits

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

Extensible

Methods

string
getDescription()

No description

setDescription(string $description)

No description

static string|null
getClassFromIdentifier(string $name)

No description

static string|null
getIdentifier(string|OperationScaffolder $instOrClass)

No description

static array
getOperations()

Gets a map of operation identifiers to their classes

__construct(string $dataObjectClass)

Delete constructor.

$this
addArgs(array $argData)

Adds args to the operation

$this
addArg(string $argName, string $typeStr, string $description = null, mixed $defaultValue = null)

No description

$this
setArgDescriptions(array $argData)

Sets descriptions of arguments [ 'Email' => 'The email of the user' ]

$this
setArgDescription(string $argName, string $description)

Sets a single arg description

$this
setArgDefaults(array $argData)

Sets argument defaults [ 'Featured' => true ]

$this
setArgDefault(string $argName, mixed $default)

Sets a default for a single arg

$this
setArgsRequired(array $argData)

Sets operation arguments as required or not [ 'ID' => true ]

setArgRequired(string $argName, bool $required)

Sets an operation argument as required or not

string
getName()

No description

$this
setName(string $name)

No description

ArrayList
getArgs()

No description

$this
setTypeName(string $typeName)

Type name

string
getTypeName()

No description

$this
removeArg(string $arg)

No description

$this
removeArgs(array $args)

No description

getResolver()

No description

$this
setResolver(callable|OperationResolver|string $resolver)

No description

applyConfig(array $config)

No description

string
getDataObjectClass()

No description

DataObject
getDataObjectInstance()

No description

$this
setDataObjectClass(string $class)

Sets the DataObject name

addToManager(Manager $manager)

No description

mixed
scaffold(Manager $manager)

No description

mixed
resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)

Invoked by the Executor class to resolve this mutation / query

Details

$this setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)

Set parent

Parameters

DataObjectScaffolder|SchemaScaffolder $parent

Return Value

$this

string getDescription()

Return Value

string

OperationScaffolder setDescription(string $description)

Parameters

string $description

Return Value

OperationScaffolder

static string|null getClassFromIdentifier(string $name)

Parameters

string $name

Return Value

string|null

static string|null getIdentifier(string|OperationScaffolder $instOrClass)

Parameters

string|OperationScaffolder $instOrClass

Return Value

string|null

static array getOperations()

Gets a map of operation identifiers to their classes

Return Value

array

__construct(string $dataObjectClass)

Delete constructor.

Parameters

string $dataObjectClass

$this addArgs(array $argData)

Adds args to the operation

Ex: [ 'MyArg' => 'String!', 'MyOtherArg' => 'Int', 'MyCustomArg' => new InputObjectType([ ]

Parameters

array $argData

Return Value

$this

$this addArg(string $argName, string $typeStr, string $description = null, mixed $defaultValue = null)

Parameters

string $argName
string $typeStr
string $description
mixed $defaultValue

Return Value

$this

$this setArgDescriptions(array $argData)

Sets descriptions of arguments [ 'Email' => 'The email of the user' ]

Parameters

array $argData

Return Value

$this

$this setArgDescription(string $argName, string $description)

Sets a single arg description

Parameters

string $argName
string $description

Return Value

$this

$this setArgDefaults(array $argData)

Sets argument defaults [ 'Featured' => true ]

Parameters

array $argData

Return Value

$this

$this setArgDefault(string $argName, mixed $default)

Sets a default for a single arg

Parameters

string $argName
mixed $default

Return Value

$this

$this setArgsRequired(array $argData)

Sets operation arguments as required or not [ 'ID' => true ]

Parameters

array $argData

Return Value

$this

OperationScaffolder setArgRequired(string $argName, bool $required)

Sets an operation argument as required or not

Parameters

string $argName
bool $required

Return Value

OperationScaffolder

string getName()

Return Value

string

$this setName(string $name)

Parameters

string $name

Return Value

$this

ArrayList getArgs()

Return Value

ArrayList

$this setTypeName(string $typeName)

Type name

Parameters

string $typeName

Return Value

$this

string getTypeName()

Return Value

string

$this removeArg(string $arg)

Parameters

string $arg

Return Value

$this

$this removeArgs(array $args)

Parameters

array $args

Return Value

$this

callable|OperationResolver getResolver()

Return Value

callable|OperationResolver

$this setResolver(callable|OperationResolver|string $resolver)

Parameters

callable|OperationResolver|string $resolver

Callable, instance of (or classname of) a OperationResolver

Return Value

$this

Exceptions

InvalidArgumentException

applyConfig(array $config)

Parameters

array $config

Exceptions

Exception

string getDataObjectClass()

Return Value

string

DataObject getDataObjectInstance()

Return Value

DataObject

$this setDataObjectClass(string $class)

Sets the DataObject name

Parameters

string $class

Return Value

$this

addToManager(Manager $manager)

Parameters

Manager $manager

mixed scaffold(Manager $manager)

Parameters

Manager $manager

Return Value

mixed

mixed resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)

Invoked by the Executor class to resolve this mutation / query

Parameters

mixed $object
array $args
mixed $context
ResolveInfo $info

Return Value

mixed