Delete.php 715 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\BBCodeList;
  10. use ForkBB\Models\Method;
  11. use ForkBB\Models\BBCodeList\BBCodeList;
  12. use PDO;
  13. class Delete extends Method
  14. {
  15. /**
  16. * Удаляет bbcode по id
  17. */
  18. public function delete(int $id): BBCodeList
  19. {
  20. $vars = [
  21. ':id' => $id,
  22. ];
  23. $query = 'DELETE
  24. FROM ::bbcode
  25. WHERE id=?i:id AND bb_delete=1';
  26. $this->c->DB->exec($query, $vars);
  27. return $this->model->reset();
  28. }
  29. }