/** * createCommentInstance * * @param string $pageId page instance id * @param string $commentInput comment parameter * * @return void */ public function createCommentInstance($pageId, $commentInput) { if ($commentInput === 'true') { if ($this->comment->getInstanceId($pageId) === null) { $this->comment->createInstance($pageId); $this->comment->configure($this->comment->getInstanceId($pageId), ['useWysiwyg' => true]); } } }
/** * 게시판 생성 * * @param array $params parameters * @return ConfigEntity */ public function create(array $params) { if (empty($params['boardId']) === true) { throw new RequiredValueException(['key' => 'boardId']); } $config = $this->configHandler->get($params['boardId']); if ($config !== null) { throw new AlreadyExistsInstanceException(); } $this->conn->beginTransaction(); $documentConfig = $this->document->createInstance($params['boardId'], $params); // create comment config(create new comment instance) $this->commentHandler->createInstance($documentConfig->get('instanceId'), $documentConfig->get('division')); $this->commentHandler->configure($this->commentHandler->getInstanceId($documentConfig->get('instanceId')), ['useWysiwyg' => true]); $params['documentGroup'] = $documentConfig->get('group'); $params['commentGroup'] = 'comments_' . $documentConfig->get('instanceId'); $config = $this->configHandler->add($params); $this->permissionHandler->setByInstanceId($params['boardId'], new Grant()); $this->conn->commit(); return $config; }