Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions en/orm/behaviors/tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The TreeBehavior helps you maintain a hierarchical data structure in the
database that can be queried without much overhead and helps reconstruct the
tree data for finding and displaying processes.


Requirements
============

Expand All @@ -31,6 +32,16 @@ You can configure the name of those fields should you need to customize them.
More information on the meaning of the fields and how they are used can be found
in this article describing the `MPTT logic <https://www.sitepoint.com/hierarchical-data-database-2/>`_

.. warning::

The TreeBehavior is not safe for concurrent write operations.
Simultaneous requests that modify tree-structured data
(e.g., insertions, deletions, or moves) can lead to corruption of the
``lft`` and ``rght`` values.

To prevent this, a locking mechanism like a
`Semaphore <https://www.php.net/manual/en/book.sem.php>`_ should be used.

.. warning::

The TreeBehavior does not support composite primary keys at this point in
Expand Down