public function addModerator($userId) { $userId = (int) $userId; if ($this->moderatorDao->getIdByUserId($userId) !== null) { return false; } $moder = new BOL_AuthorizationModerator(); $moder->userId = $userId; $this->moderatorDao->save($moder); $this->giveAllPermissions($moder->getId()); return true; }