Load.php 664 B

1234567891011121314151617181920212223242526272829
  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 PDO;
  12. class Load extends Method
  13. {
  14. /**
  15. * Загружает данные из БД для модели и кеша
  16. */
  17. public function load(): array
  18. {
  19. $query = 'SELECT id, sm_code, sm_image, sm_position
  20. FROM ::smilies
  21. ORDER BY sm_position';
  22. return $this->c->DB->query($query)->fetchAll(PDO::FETCH_UNIQUE);
  23. }
  24. }