public function delete($key) { $config = new Config(); if ($config->readKey($key)) { $id = $config->id; $this->app->render($config->delete() ? 200 : 500, ['response' => $id]); } else { $this->app->render(404); } }
/** * @param int $id * @return int */ protected function deleteValue($id) { $config = new Config(); $config->read($id); if ($config->delete()) { $this->printLine("Key with the id: {$id} has been deleted!"); return 0; } $this->printLine("Could not delete the key with the id: {$id}!"); return 255; }