What are the model, lft, and rght fields used in the acos table?
Asked Answered
E

1

8

What are the cakePHP usages/meanings of the model, lft, and rght fields in a acos table? Similarly, what are the usages/meanings of the lft and rght fields in a aros table?

Elohim answered 24/4, 2010 at 17:20 Comment(0)
F
9

They are required by the Modified Pre-order Tree Traversal data modelling technique commonly used for modelling hierarchical data. They allow quick single query ways of selecting all nodes in a branch. This means you don't have to use recursion and multiple queries. I.e.

SELECT * FROM tree WHERE left > 4 AND right < 8

Where 4 and 8 might be the left and right values of a parent node, whose children and grand children you want to extract.

Framboise answered 24/4, 2010 at 19:29 Comment(1)
can be automatically filled or fixed by running console script: cake AclExtras.AclExtras recover aroLacking

© 2022 - 2024 — McMap. All rights reserved.