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
Table of Contents
Properties
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
$_purge
private
string|null
$_purge
= null
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.