Oihana PHP Arango

EdgesPurgeTrait

Trait to manage automatic purge rules for edges in ArangoDB.

This trait allows an edge collection to define which connected documents should be automatically deleted when a vertex is removed. The purge direction is controlled using the Purge enum:

  • Purge::OUTBOUND : Purge the target ('to') documents when a source ('from') vertex is deleted.
  • Purge::INBOUND : Purge the source ('from') documents when a target ('to') vertex is deleted.
  • Purge::BOTH : Purge both 'from' and 'to' documents when either vertex is deleted.

Example usage:

$edges->initializePurge([AQL::PURGE => Purge::OUTBOUND]);
Tags
version
1.0.0

Table of Contents

Properties

$purge  : string|null
The purge mode for this edge collection.
$_purge  : string|null

Methods

initializePurge()  : static
Initialize the purge property from an array or string.

Properties

$purge virtual

The purge mode for this edge collection.

public string|null $purge

One of the constants defined in Purge or null if no purge is configured.

Hooks
public string|null get public set

Methods

initializePurge()

Initialize the purge property from an array or string.

public initializePurge([array<string|int, mixed>|string|null $init = null ]) : static
Parameters
$init : array<string|int, mixed>|string|null = null

If array, looks for the key AQL::PURGE; if string, directly sets the purge mode.

Return values
static
On this page

Search results