| @@ 45-58 (lines=14) @@ | ||
| 42 | * |
|
| 43 | * @return bool |
|
| 44 | */ |
|
| 45 | public static function hasRootEntityWithForeignKeyIdentifier(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry) : bool |
|
| 46 | { |
|
| 47 | foreach ($queryBuilder->getRootEntities() as $rootEntity) { |
|
| 48 | $rootMetadata = $managerRegistry |
|
| 49 | ->getManagerForClass($rootEntity) |
|
| 50 | ->getClassMetadata($rootEntity); |
|
| 51 | ||
| 52 | if ($rootMetadata->containsForeignIdentifier) { |
|
| 53 | return true; |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | return false; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Determines whether the query builder has any composite identifier. |
|
| @@ 68-81 (lines=14) @@ | ||
| 65 | * |
|
| 66 | * @return bool |
|
| 67 | */ |
|
| 68 | public static function hasRootEntityWithCompositeIdentifier(QueryBuilder $queryBuilder, ManagerRegistry $managerRegistry) : bool |
|
| 69 | { |
|
| 70 | foreach ($queryBuilder->getRootEntities() as $rootEntity) { |
|
| 71 | $rootMetadata = $managerRegistry |
|
| 72 | ->getManagerForClass($rootEntity) |
|
| 73 | ->getClassMetadata($rootEntity); |
|
| 74 | ||
| 75 | if ($rootMetadata->isIdentifierComposite) { |
|
| 76 | return true; |
|
| 77 | } |
|
| 78 | } |
|
| 79 | ||
| 80 | return false; |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * Determines whether the query builder has the maximum number of results specified. |
|