public function deleteModerator($moderatorId) { $moderatorId = (int) $moderatorId; $adminGroupId = $this->getAdminGroupId(); if ($this->moderatorPermissionDao->getId($moderatorId, $adminGroupId) !== null) { return false; } $removed = $this->moderatorDao->deleteById($moderatorId) > 0; // ? true : false; if ($removed) { $this->moderatorPermissionDao->deleteByModeratorId($moderatorId); } return $removed; }