API request.
Methods Summary
# __construct( string $operation , string $resource )
Construct an API request.
# getOperation( )
Get the request operation.
# getResource( )
Get the request resource.
# setId( mixed $id )
Set the request resource ID.
# getId( )
Get the request resource ID.
# setIds( array $ids )
Set the request resource IDs.
# getIds( )
Get the request resource IDs.
# setFileData( array $fileData )
Set the file data for the request.
# getFileData( )
Get the file data for the request.
# 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)
# getOption( null|string|int $key = NULL, null|mixed $default = NULL )
Get all options or a single option as specified by key.
# setContent( array $value )
Set request content. The API request content must always be an array.
# getContent( )
Get request content.
# 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
protected string $resource
protected mixed $id
protected array $ids
# array ( )
protected array $fileData
# array ( )
protected array $options
# array ( )
protected array $content
# array ( )