This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Doctrine; | |
| use ApiPlatform\Doctrine\Orm\Extension\QueryCollectionExtensionInterface; | |
| use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface; | |
| use ApiPlatform\Metadata\Operation; | |
| use App\Entity\BusinessUnit; | |
| use Doctrine\ORM\QueryBuilder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final public function fetchAllChildUnitUUIDs(string $parentId): array | |
| { | |
| $connection = $this->entityManager->getConnection(); | |
| $sql = ' | |
| WITH RECURSIVE library_unit_hierarchy AS ( | |
| SELECT lu.id, lu.parent_uuid, 0 AS depth | |
| FROM library_unit bu | |
| WHERE lu.id = :parentId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| readonly class LibraryUnitGetChildUnitsStateProvider implements ProviderInterface | |
| { | |
| /** | |
| * @param ProviderInterface<CollectionProvider> $itemProvider | |
| */ | |
| public function __construct( | |
| #[Autowire(service: 'api_platform.doctrine.orm.state.collection_provider')] | |
| private ProviderInterface $itemProvider, | |
| private LibraryUnitRepository $unitRepository, | |
| ) { |