|
@@ 576-578 (lines=3) @@
|
| 573 |
|
$this->owner->setAttribute($this->treeAttribute, $id); |
| 574 |
|
|
| 575 |
|
$primaryKey = $this->owner->primaryKey(); |
| 576 |
|
if (!isset($primaryKey[0])) { |
| 577 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 578 |
|
} |
| 579 |
|
|
| 580 |
|
$this->owner->updateAll([$this->treeAttribute => $id], [$primaryKey[0] => $id]); |
| 581 |
|
} |
|
@@ 584-586 (lines=3) @@
|
| 581 |
|
} |
| 582 |
|
if ($this->owner->getAttribute($this->pathAttribute) === null) { |
| 583 |
|
$primaryKey = $this->owner->primaryKey(); |
| 584 |
|
if (!isset($primaryKey[0])) { |
| 585 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 586 |
|
} |
| 587 |
|
$id = $this->getPrimaryKeyValue(); |
| 588 |
|
if ($this->operation === self::OPERATION_MAKE_ROOT) { |
| 589 |
|
$path = $id; |