Delete.php 741 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * This file is part of the ForkBB <https://github.com/forkbb>.
  4. *
  5. * @copyright (c) Visman <mio.visman@yandex.ru, https://github.com/MioVisman>
  6. * @license The MIT License (MIT)
  7. */
  8. declare(strict_types=1);
  9. namespace ForkBB\Models\SmileyList;
  10. use ForkBB\Models\Method;
  11. use ForkBB\Models\SmileyList\SmileyList;
  12. class Delete extends Method
  13. {
  14. /**
  15. * Удаляет смайл из БД
  16. * Удаляет кеш смайлов
  17. */
  18. public function delete(int $id): SmileyList
  19. {
  20. $vars = [
  21. ':id' => $id,
  22. ];
  23. $query = 'DELETE
  24. FROM ::smilies
  25. WHERE id=?i:id';
  26. $this->c->DB->exec($query, $vars);
  27. return $this->model->reset();
  28. }
  29. }