Delete.php 862 B

1234567891011121314151617181920212223242526272829303132333435363738
  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\BanList;
  10. use ForkBB\Models\Method;
  11. use ForkBB\Models\BanList\BanList;
  12. class Delete extends Method
  13. {
  14. /**
  15. * Удаляет из банов записи по списку номеров
  16. * Обновляет кеш
  17. */
  18. public function delete(int ...$ids): BanList
  19. {
  20. if (! empty($ids)) {
  21. $vars = [
  22. ':ids' => $ids,
  23. ];
  24. $query = 'DELETE
  25. FROM ::bans
  26. WHERE id IN (?ai:ids)';
  27. $this->c->DB->exec($query, $vars);
  28. $this->model->reset();
  29. }
  30. return $this->model;
  31. }
  32. }