StatusService.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Drupal\statusmessage;
  3. use Drupal\Core\Database\Driver\mysql\Connection;
  4. use Drupal\Core\Entity\EntityTypeManager;
  5. use Drupal\Core\Entity\Query\QueryFactory;
  6. use Drupal\Core\Database\Database;
  7. use Drupal\flag\FlagService;
  8. /**
  9. * Class StatusService.
  10. *
  11. * @package Drupal\statusmessage
  12. */
  13. class StatusService {
  14. /**
  15. * Drupal\Core\Database\Driver\mysql\Connection definition.
  16. *
  17. * @var Drupal\Core\Database\Driver\mysql\Connection
  18. */
  19. protected $database;
  20. /**
  21. * Drupal\Core\Entity\EntityTypeManager definition.
  22. *
  23. * @var Drupal\Core\Entity\EntityTypeManager
  24. */
  25. protected $entity_type_manager;
  26. /**
  27. * Drupal\Core\Entity\Query\QueryFactory definition.
  28. *
  29. * @var Drupal\Core\Entity\Query\QueryFactory
  30. */
  31. protected $entity_query;
  32. /**
  33. * Drupal\flag\FlagService definition.
  34. *
  35. * @var Drupal\flag\FlagService
  36. */
  37. protected $flag;
  38. /**
  39. * Constructor.
  40. */
  41. public function __construct(Connection $database, EntityTypeManager $entity_type_manager, QueryFactory $entity_query, FlagService $flag) {
  42. $this->database = $database;
  43. $this->entity_type_manager = $entity_type_manager;
  44. $this->entity_query = $entity_query;
  45. $this->flag = $flag;
  46. }
  47. public function getMimeTypes() {
  48. return ['image/jpeg', 'image/png', 'application/octet-stream', 'video/mp4', 'text/plain', 'application/pdf', 'image/gif'];
  49. }
  50. }