'staff_2', 'requestData' => [ 'name' => [ 'validation' => DataValidator::notBlank()->length(LengthConfig::MIN_LENGTH_NAME, LengthConfig::MAX_LENGTH_NAME), 'error' => ERRORS::INVALID_TITLE ], ] ]; } public function handler() { $name = Controller::request('name', true); $icon = Controller::request('icon'); $iconColor = Controller::request('iconColor'); $private = Controller::request('private') ? 1 : 0; $CreatedTopic = Topic::getDataStore($name, 'name'); if(!$CreatedTopic->isNull()){ throw new RequestException(ERRORS::NAME_ALREADY_USED); } $topic = new Topic(); $topic->setProperties([ 'name' => $name, 'icon' => $icon, 'iconColor' => $iconColor, 'private' => $private ]); Log::createLog('ADD_TOPIC', $topic->name); Response::respondSuccess([ 'topicId' => $topic->store() ]); } }