class ModelMethod extends Method

Helper class to define webservice methods.

Properties

protected Model $model

Methods

__construct(string $name)

Method constructor.

addInputParameter(string $parameter, string $type, bool|null $required = null, string|null $description = null, mixed $defaultValue = null, ParameterObject|null $parameterObject = null)

Adds an input parameter to the method definition.

from  Method
addInputXQLParameterObject(ParameterObject $parameterObject = null)

No description

from  Method
addOutputParameter(string $parameter, string $type, string|null $description = null, ParameterObject|null $parameterObject = null)

Adds an output parameter to the method definition.

from  Method
static ModelMethod
create(Model $model, string $methodType)

No description

array
execute(array $arguments = [])

Execute Method with argument supplied by the API

from  Method
array
extractAttachmentInfoFromInputArray(array $inputData)

Extract attachment information from InputArray

array
getAttachmentProperties()

No description

callable|null
getCallback()

No description

from  Method
string|null
getDescription()

No description

from  Method
string
getHttpMethod()

No description

from  Method
array
getInputParameters()

No description

from  Method
bool|null
getIsInternal()

No description

from  Method
string
getName()

The name depends on the version. If a version bigger than 1 is set, the method name is suffixed with _v{$versionNumber}

from  Method
array
getOutputParameters()

No description

from  Method
string|null
getResource()

No description

from  Method
string|null
getResourceId()

No description

from  Method
int
getVersion()

No description

from  Method
void
processAttachmentProperties(DocumentModel $model, array $attachmentInfo = [])

Add / Remove attachments for model

setAttachmentProperties(array $properties)

No description

setCallback(callable|null $callback = null)

Instead of a defining a separate function in the service hook,

from  Method
setDescription(string|null $description)

No description

from  Method
setIsInternal(bool|null $isInternal)

No description

from  Method
setName(string $name)

No description

from  Method
setRestApiInfo(string $httpMethod = 'POST', string $resource = null, string $resourceId = null)

No description

from  Method
setVersion(int $version)

No description

from  Method

Details

at line 25
protected __construct(string $name)

Method constructor.

Parameters

string $name

in Method at line 64
Method addInputParameter(string $parameter, string $type, bool|null $required = null, string|null $description = null, mixed $defaultValue = null, ParameterObject|null $parameterObject = null)

Adds an input parameter to the method definition.

Beware: The order of the parameters matters!

Parameters

string $parameter
string $type
bool|null $required
string|null $description
mixed $defaultValue
ParameterObject|null $parameterObject

If you use the type Method::OBJECT provide a definition of the object members

Return Value

Method

See also

Types for valid XSD type constants

in Method at line 259
Method addInputXQLParameterObject(ParameterObject $parameterObject = null)

No description

Parameters

ParameterObject $parameterObject

Return Value

Method

in Method at line 94
Method addOutputParameter(string $parameter, string $type, string|null $description = null, ParameterObject|null $parameterObject = null)

Adds an output parameter to the method definition.

Beware: The order of the parameters matters!

Parameters

string $parameter
string $type
string|null $description
ParameterObject|null $parameterObject

If you use the type Method::OBJECT provide a definition of the object members

Return Value

Method

See also

Types for valid XSD type constants

at line 21
static ModelMethod create(Model $model, string $methodType)

No description

Parameters

Model $model
string $methodType

Return Value

ModelMethod

in Method at line 178
array execute(array $arguments = [])

Execute Method with argument supplied by the API

Parameters

array $arguments

Return Value

array

at line 51
array extractAttachmentInfoFromInputArray(array $inputData)

Extract attachment information from InputArray

Parameters

array $inputData

Return Value

array

at line 41
array getAttachmentProperties()

No description

Return Value

array

in Method at line 155
callable|null getCallback()

No description

Return Value

callable|null

in Method at line 198
string|null getDescription()

No description

Return Value

string|null

in Method at line 220
string getHttpMethod()

No description

Return Value

string

in Method at line 78
array getInputParameters()

No description

Return Value

array

in Method at line 254
bool|null getIsInternal()

No description

Return Value

bool|null

in Method at line 115
string getName()

The name depends on the version. If a version bigger than 1 is set, the method name is suffixed with _v{$versionNumber}

Return Value

string

in Method at line 106
array getOutputParameters()

No description

Return Value

array

in Method at line 228
string|null getResource()

No description

Return Value

string|null

in Method at line 236
string|null getResourceId()

No description

Return Value

string|null

in Method at line 138
int getVersion()

No description

Return Value

int

at line 68
void processAttachmentProperties(DocumentModel $model, array $attachmentInfo = [])

Add / Remove attachments for model

Parameters

DocumentModel $model
array $attachmentInfo

Return Value

void

at line 36
ModelMethod setAttachmentProperties(array $properties)

No description

Parameters

array $properties

Return Value

ModelMethod

in Method at line 166
Method setCallback(callable|null $callback = null)

Instead of a defining a separate function in the service hook,

Parameters

callable|null $callback

Return Value

Method

in Method at line 189
Method setDescription(string|null $description)

No description

Parameters

string|null $description

Return Value

Method

in Method at line 245
Method setIsInternal(bool|null $isInternal)

No description

Parameters

bool|null $isInternal

Return Value

Method

in Method at line 130
Method setName(string $name)

No description

Parameters

string $name

Return Value

Method

in Method at line 210
Method setRestApiInfo(string $httpMethod = 'POST', string $resource = null, string $resourceId = null)

No description

Parameters

string $httpMethod
string $resource

e.g. user

string $resourceId

e.g. id

Return Value

Method

in Method at line 147
Method setVersion(int $version)

No description

Parameters

int $version

If a version bigger than 1 is given, the function name is suffixed with _v{$versionNumber}

Return Value

Method