|
@@ 539-541 (lines=3) @@
|
| 536 |
|
$this->owner->setAttribute($this->treeAttribute, $id); |
| 537 |
|
|
| 538 |
|
$primaryKey = $this->owner->primaryKey(); |
| 539 |
|
if (!isset($primaryKey[0])) { |
| 540 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 541 |
|
} |
| 542 |
|
|
| 543 |
|
$this->owner->updateAll([$this->treeAttribute => $id], [$primaryKey[0] => $id]); |
| 544 |
|
} |
|
@@ 547-549 (lines=3) @@
|
| 544 |
|
} |
| 545 |
|
if ($this->owner->getAttribute($this->pathAttribute) === null) { |
| 546 |
|
$primaryKey = $this->owner->primaryKey(); |
| 547 |
|
if (!isset($primaryKey[0])) { |
| 548 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 549 |
|
} |
| 550 |
|
$id = $this->owner->getPrimaryKey(); |
| 551 |
|
if ($this->operation === self::OPERATION_MAKE_ROOT) { |
| 552 |
|
$path = $id; |