entityhandler.class.php 572 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. class EntityHandler
  3. {
  4. public function getEntities(): array
  5. {
  6. global $db;
  7. $result = [];
  8. $sql = "
  9. SELECT *
  10. FROM ".MAIN_DB_PREFIX."entity
  11. WHERE active=1
  12. ORDER BY label ASC
  13. ";
  14. $rows = $db->query($sql);
  15. if ($rows) {
  16. while ($row = $db->fetch_object($rows)) {
  17. $result[] = [
  18. 'id' => $row->rowid,
  19. 'label' => $row->label
  20. ];
  21. }
  22. }
  23. return $result;
  24. }
  25. }