Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }