RoutingIndexer.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace Opentalent\OtRouter\Controller;
  3. use Opentalent\OtCore\Domain\Repository\OrganizationRepository;
  4. use Opentalent\OtCore\Page\OtPageRepository;
  5. use TYPO3\CMS\Core\Database\ConnectionPool;
  6. /**
  7. * Provides methods to index the Typo3 pages and populate the routing db table
  8. *
  9. * @package Opentalent\OtRouter\Controller
  10. */
  11. class RoutingIndexer
  12. {
  13. const INDEX_TABLENAME = 'tx_opentalent_router';
  14. /**
  15. * @var ConnectionPool
  16. */
  17. private ConnectionPool $connectionPool;
  18. public function injectConnectionPool(ConnectionPool $connectionPool)
  19. {
  20. $this->connectionPool = $connectionPool;
  21. }
  22. /**
  23. * @var OtPageRepository
  24. */
  25. protected OtPageRepository $otPageRepository;
  26. public function injectOtPageRepository(OtPageRepository $otPageRepository) {
  27. $this->otPageRepository = $otPageRepository;
  28. }
  29. protected OrganizationRepository $organizationRepository;
  30. public function injectOrganizationRepository(OrganizationRepository $organizationRepository) {
  31. $this->organizationRepository = $organizationRepository;
  32. }
  33. /**
  34. * Clear then repopulate the whole index
  35. */
  36. public function indexAllRoutes() {
  37. }
  38. /**
  39. * Clear and recreate the index entry for the target website organization
  40. *
  41. * @param int $organizationId
  42. */
  43. public function indexRoutesFor(int $organizationId) {
  44. }
  45. }