|
@@ 458-460 (lines=3) @@
|
| 455 |
|
$this->owner->setAttribute($this->treeAttribute, $id); |
| 456 |
|
|
| 457 |
|
$primaryKey = $this->owner->primaryKey(); |
| 458 |
|
if (!isset($primaryKey[0])) { |
| 459 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 460 |
|
} |
| 461 |
|
|
| 462 |
|
$this->owner->updateAll([$this->treeAttribute => $id], [$primaryKey[0] => $id]); |
| 463 |
|
} |
|
@@ 466-468 (lines=3) @@
|
| 463 |
|
} |
| 464 |
|
if ($this->owner->getAttribute($this->pathAttribute) === null) { |
| 465 |
|
$primaryKey = $this->owner->primaryKey(); |
| 466 |
|
if (!isset($primaryKey[0])) { |
| 467 |
|
throw new Exception('"' . $this->owner->className() . '" must have a primary key.'); |
| 468 |
|
} |
| 469 |
|
$id = $this->owner->getPrimaryKey(); |
| 470 |
|
if ($this->operation === self::OPERATION_MAKE_ROOT) { |
| 471 |
|
$path = $id; |