Oihana PHP Arango

PropertyControllerPatchTrait uses trait:short

Table of Contents

Methods

patch()  : mixed
Update a part of a document in a collection with a specific identifier (by default use the _key attribute).
update()  : mixed
Provides the functionality to update or replace documents in an ArangoDB collection using PATCH or PUT HTTP methods. This trait handles: - Document existence verification.

Methods

patch()

Update a part of a document in a collection with a specific identifier (by default use the _key attribute).

public patch([ServerRequestInterface|null $request = null ][, ResponseInterface|null $response = null ][, array<string|int, mixed> $args = [] ][, array<string|int, mixed> $init = [] ]) : mixed

Example: PATCH ../collection/{id}

Parameters
$request : ServerRequestInterface|null = null
$response : ResponseInterface|null = null
$args : array<string|int, mixed> = []

An associative array that contains values for the current route’s named placeholders.

$init : array<string|int, mixed> = []

An optional associative array to initialize the method.

Tags
throws
ContainerExceptionInterface
NotFoundExceptionInterface

update()

Provides the functionality to update or replace documents in an ArangoDB collection using PATCH or PUT HTTP methods. This trait handles: - Document existence verification.

public update([ServerRequestInterface|null $request = null ][, ResponseInterface|null $response = null ][, array<string|int, mixed> $args = [] ][, array<string|int, mixed> $init = [] ]) : mixed
  • Preparation and filtering of document data.
  • Validation against defined rules.
  • Conditional update (PATCH) or replacement (PUT) of documents.
  • Hooks for pre- and post-update actions (beforeUpdate and afterUpdate).

Usage:

  • PATCH ../collection/{id} -> Partial update
  • PUT ../collection/{id} -> Full replacement
Parameters
$request : ServerRequestInterface|null = null

Optional PSR-7 ServerRequest instance.

$response : ResponseInterface|null = null

Optional PSR-7 Response instance.

$args : array<string|int, mixed> = []

Route parameters (e.g., ['id' => '_key']).

$init : array<string|int, mixed> = []

Initialization options and additional context.

Return values
mixed

The updated document data on success, or a standardized error response on failure.

On this page

Search results