Boilerplate to use a Directus Instance to Build a Custom Website, Content will be Manage by Directus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
707 B

  1. <?php
  2. namespace App\Repositories;
  3. /**
  4. *
  5. *
  6. * @author Björn Hase, Tentakelfabrik
  7. * @license http://opensource.org/licenses/MIT The MIT License
  8. * @link https://gitea.tentakelfabrik.de/Tentakelfabrik/super-gear-directus
  9. *
  10. */
  11. abstract class RepositoryAbstract
  12. {
  13. /** endpoint for request */
  14. protected $endpoint;
  15. /** queryBuilder from pirectus */
  16. protected $queryBuilder;
  17. /**
  18. *
  19. *
  20. */
  21. public function __construct()
  22. {
  23. $pirectus = \Flight::pirectus();
  24. if ($pirectus) {
  25. $this->queryBuilder = $pirectus->items($this->endpoint);
  26. } else {
  27. throw new \Exception('Error! Pirectus not initialized!');
  28. }
  29. }
  30. }