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