grpno = $entity->getPrimaryKey(); return $entity; } //부모의 그룹과 grpno가 같고, 부모의 grporder보다 1 큰것을 grporder+1을 해서 update private function setHierarchyUpdate($entity) { // return false; //escape -> false옵션 반드시 있어야함 $this->builder()->set('grporder', 'grporder+1', false); $this->builder()->where([ 'grpno' => $entity->grpno, 'grporder >' => $entity->grporder ]); $this->builder()->update(); // echo $this->getLastQuery(); // exit; } final protected function setHierarchyReply($entity, $replyEntity) { $this->setHierarchyUpdate($entity); //reply용 설정 $replyEntity->grpno = $entity->grpno; $replyEntity->grporder = $entity->grporder + 1; $replyEntity->grpdepth = $entity->grpdepth + 1; return $replyEntity; } protected function changeFormData($field, $value) { switch ($field) { case 'passwd': return $value ? password_hash($value, PASSWORD_DEFAULT) : ""; break; case 'content': return htmlentities($value); break; case 'status': return $value ?: DEFAULTS['STATUS']; break; default: return $value; break; } } final protected function create_process($entity) { //primaryKey 할당 if ($this->useAutoIncrement === false) { $pk = $this->primaryKey; $entity->$pk = $this->getUUIDv5_CommonTrait(); } // echo var_export($entity, true); // exit; if (!$this->save($entity)) { Log::add("error", __FUNCTION__ . "에서 호출:" . $this->getLastQuery()); Log::add("error", implode("\n", $this->errors())); throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->errors(), true)); } // echo "