save()) { throw new RuntimeException('Saving error.'); } } /** * @param Language $language * @throws StaleObjectException */ public function remove(Language $language): void { if (!$language->delete()) { throw new RuntimeException('Removing error.'); } } public function clearDefaults() { Language::updateAll(['default' => 0]); } }