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
| // Doctrine Type | |
| final class YourCustomType extends Type | |
| { | |
| public const NAME = 'your_custom_type'; | |
| private YourCustomService $yourCustomService; | |
| public function setYourCustomService(YourCustomService $yourCustomService): void | |
| { |
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
| class ForUpdateOfTableWalker extends SqlWalker | |
| { | |
| public const FOR_UPDATE_OF_TABLE = 'ForUpdateOfTable'; | |
| public function walkSelectStatement(SelectStatement $AST): string | |
| { | |
| $sql = parent::walkSelectStatement($AST); | |
| /** @var array $hint */ | |
| $hint = $this->getQuery()->getHint(self::FOR_UPDATE_OF_TABLE); |
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
| services: | |
| routable.event.bus: | |
| class: Symfony\Component\Messenger\RoutableMessageBus | |
| arguments: | |
| - !tagged_locator { tag: 'messenger.bus', index_by: 'id' } | |
| - '@event.bus' |
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
| document.body.removeEventListener('mousedown',getEventListeners(document.body).mousedown[0].listener) | |
| document.removeEventListener('copy',getEventListeners(document).copy[0].listener) | |
| document.removeEventListener('paste',getEventListeners(document).paste[0].listener) | |
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
| public function findCategories(): array | |
| { | |
| // dfs preorder tree traversal | |
| $sql = <<<'SQL' | |
| WITH RECURSIVE preorder_categories_traversal | |
| AS (SELECT category.id, | |
| category.parent_id, | |
| ARRAY [ROW (category.sort_order,category.id)] AS path | |
| FROM categories category |
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
| public function hasEntities(): bool | |
| { | |
| $qb = $this->createYourQueryBuilder(); | |
| $qb->select((string)$qb->expr()->literal('1')) | |
| ->setMaxResults(1); | |
| $result = $qb->getQuery()->getOneOrNullResult(); | |
| return null !== $result; |
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
| return new StreamedResponse( | |
| static fn (): int => fpassthru($photo->stream), | |
| headers: [ | |
| 'Content-Type' => $photo->mimeType, | |
| 'Content-Length' => $photo->fileSize, | |
| 'Content-Disposition' => HeaderUtils::makeDisposition( | |
| HeaderUtils::DISPOSITION_INLINE, | |
| $photo->baseName, | |
| ), | |
| ], |
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
| zcat ./table-dump.sql.gz | docker compose exec -T --env PGPASSWORD=qwerty postgresql_container psql -h postgresql_container -U postgres_user "database_name" |
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
| $queryBuilder = $this->createQueryBuilder('journal'); | |
| $queryBuilder | |
| ->select('journal.number'); | |
| /** @var array $result */ | |
| $result = $queryBuilder->getQuery()->getSingleColumnResult(); |
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
| app.dbal.schema_filter: | |
| class: Doctrine\Bundle\DoctrineBundle\Dbal\RegexSchemaAssetFilter | |
| arguments: [ '#^(?!(table1|table2)$).*#' ] | |
| tags: | |
| - { name: doctrine.dbal.schema_filter } |