ElementsController

Package: Controller

class ElementsController

extends ApiController

The controller for API /elements.

ElementsController::deleteAction()

Handle DELETE requests.

ElementsController::init()

Initialize this controller.

ElementsController::indexAction()

Handle GET request without ID.

ElementsController::getAction()

Handle GET request with ID.

ElementsController::postAction()

Handle POST requests.

ElementsController::putAction()

Handle PUT requests.

ElementsController::_validateRecordType($recordType)

Validate a record type.

Parameters:
  • $recordType (string) –
ElementsController::_validateUser(Omeka_Record_AbstractRecord $record, $privilege)

Validate a user against a privilege.

For GET requests, assume that records without an ACL resource do not require a permission check. Note that for POST, PUT, and DELETE, all records must define an ACL resource.

Parameters:
ElementsController::_getRecordAdapter($recordType)

Get the adapter for a record type.

Parameters:
  • $recordType (string) –
Returns:

Omeka_Record_Api_AbstractRecordAdapter

ElementsController::_setLinkHeader($perPage, $page, $totalResults, $resource)

Set the Link header for pagination.

Parameters:
  • $perPage (int) –
  • $page (int) –
  • $totalResults (int) –
  • $resource (string) –
ElementsController::_getRepresentation(Omeka_Record_Api_AbstractRecordAdapter $recordAdapter, Omeka_Record_AbstractRecord $record, $resource)

Get the representation of a record.

Parameters: