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