We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82d279c commit 8607dafCopy full SHA for 8607daf
docs/LTREE-TYPE.md
@@ -122,6 +122,10 @@ class MyEntity implements \Stringable
122
throw new \InvalidArgumentException("Parent MyEntity can't be self");
123
}
124
125
+ if (in_array($this->getId()->toBase58(), $parent->getPath()->getBranch(), true)) {
126
+ throw new \InvalidArgumentException("Parent MyEntity can't be a child of the current MyEntity");
127
+ }
128
+
129
$this->parent = $parent;
130
131
// Use createLeaf() to create a new Ltree instance
@@ -156,7 +160,7 @@ final readonly class MyEntityListener
156
160
{
157
161
if ($eventArgs->hasChangedField('path')) {
158
162
foreach($entity->getChildren() as $child) {
159
- $child->setParent($myEntity);
163
+ $child->setParent($entity);
164
165
166
0 commit comments