|
@@ 584-586 (lines=3) @@
|
| 581 |
|
$this->owner->setAttribute($this->treeAttribute, $id); |
| 582 |
|
|
| 583 |
|
$primaryKey = $this->owner->primaryKey(); |
| 584 |
|
if (!isset($primaryKey[0])) { |
| 585 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 586 |
|
} |
| 587 |
|
|
| 588 |
|
$this->owner->updateAll([$this->treeAttribute => $id], [$primaryKey[0] => $id]); |
| 589 |
|
} |
|
@@ 592-594 (lines=3) @@
|
| 589 |
|
} |
| 590 |
|
if ($this->owner->getAttribute($this->pathAttribute) === null) { |
| 591 |
|
$primaryKey = $this->owner->primaryKey(); |
| 592 |
|
if (!isset($primaryKey[0])) { |
| 593 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 594 |
|
} |
| 595 |
|
$id = $this->getPrimaryKeyValue(); |
| 596 |
|
if ($this->operation === self::OPERATION_MAKE_ROOT) { |
| 597 |
|
$path = $id; |