Oihana PHP Arango

ArrayMode uses ConstantsTrait

Defines the ordering and uniqueness mode of an embedded array field managed by {@see oihana\arango\models\traits\DocumentsArrayTrait}.

The mode is declared once per field through the arrays model option and drives how mutations behave — whether duplicates are allowed, whether values are kept sorted, and whether positional moves are supported:

  • LIST : ordered by insertion, duplicates allowed, arrayMove() supported.
  • SET : ordered by insertion, values kept unique, arrayMove() supported.
  • SORTED_SET : values kept unique AND sorted by value; arrayMove() is meaningless (the sort wins) and therefore unsupported.

Example:

'arrays' =>
[
    'tracks' => [ ArrayMode::LIST , Arango::COUNTER => 'numberOfTracks' ],
    'tags'   => ArrayMode::SET ,
    'genres' => ArrayMode::SORTED_SET ,
]

Table of Contents

Constants

LIST  : string = 'list'
Ordered by insertion, duplicates allowed. Positional moves are supported.
SET  : string = 'set'
Unique values, ordered by insertion. Positional moves are supported.
SORTED_SET  : string = 'sortedSet'
Unique values kept sorted by value. Positional moves are unsupported.

Constants

LIST

Ordered by insertion, duplicates allowed. Positional moves are supported.

public string LIST = 'list'

SET

Unique values, ordered by insertion. Positional moves are supported.

public string SET = 'set'

SORTED_SET

Unique values kept sorted by value. Positional moves are unsupported.

public string SORTED_SET = 'sortedSet'
On this page

Search results