Request

API request.
Methods Summary
public
# __construct( string $operation , string $resource )
Construct an API request.
public
# getOperation( )
Get the request operation.
public
# getResource( )
Get the request resource.
public
# setId( mixed $id )
Set the request resource ID.
public
# getId( )
Get the request resource ID.
public
# setIds( array $ids )
Set the request resource IDs.
public
# getIds( )
Get the request resource IDs.
public
# setFileData( array $fileData )
Set the file data for the request.
public
# getFileData( )
Get the file data for the request.
public
# setOption( string|int|array $spec , mixed $value = NULL )
Set a request option or options. Options that affect the execution of a request are: - initialize: (bool) Set whether to initialize the request during execute() (e.g. trigger API-pre events). Default is true. - finalize: (bool) Set whether to finalize the request during execute() (e.g. trigger API-post events and transform response content according to the "responseContent" option). Default is true. - returnScalar: (string) Set which field/column to return as an array of scalars during a SEARCH request. The request will not finalize when this option is set. Default is false (default behavior). - isPartial: (bool) Set whether this is a partial UPDATE request (aka PATCH). Default is false. - collectionAction: (string) Set which action to take on certain collections during a partial UPDATE request. Default is "replace", which is normal UPDATE behavior. The actions are: - replace: the passed data replaces the collection - append: append passed data to collections - remove: remove passed data from collections - continueOnError: (bool) Set whether a BATCH_CREATE operation should continue processing on error. Default is false. - flushEntityManager: (bool) Set whether to flush the entity manager during CREATE, UPDATE, and DELETE. Default is true. - responseContent: (string) Set the type of content the API response should contain. Default is "representation". The types are: - representation: an API resource representation (implements Omeka\Api\Representation\RepresentationInterface) - reference: an API resource reference (instance of Omeka\Api\Representation\ResourceReference) - resource: an API resource (implements Omeka\Api\ResourceInterface)
public
# getOption( null|string|int $key = NULL, null|mixed $default = NULL )
Get all options or a single option as specified by key.
public
# setContent( array $value )
Set request content. The API request content must always be an array.
public
# getContent( )
Get request content.
public
# getValue( string $key , mixed $default = NULL )
Get a value from the content by key.
Constants Summary
public string CREATE
# 'create'
public string BATCH_CREATE
# 'batch_create'
public string BATCH_UPDATE
# 'batch_update'
public string BATCH_DELETE
# 'batch_delete'
public string READ
# 'read'
public string UPDATE
# 'update'
public string DELETE
# 'delete'
Properties Summary
protected array $operations
# array ( 0 => 'search', 1 => 'create', 2 => 'batch_create', 3 => 'batch_update', 4 => 'read', 5 => 'update', 6 => 'delete', 7 => 'batch_delete', )
protected string $operation
# NULL
protected string $resource
# NULL
protected mixed $id
# NULL
protected array $ids
# array ( )
protected array $fileData
# array ( )
protected array $options
# array ( )
protected array $content
# array ( )