| @@ 275-290 (lines=16) @@ | ||
| 272 | } |
|
| 273 | ||
| 274 | // Evaluate @NamedQueries annotation |
|
| 275 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
|
| 276 | /** @var Annotation\NamedQueries $namedQueriesAnnot */ |
|
| 277 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
|
| 278 | ||
| 279 | if (! is_array($namedQueriesAnnot->value)) { |
|
| 280 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
|
| 281 | } |
|
| 282 | ||
| 283 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
|
| 284 | if (! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 285 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
|
| 286 | } |
|
| 287 | ||
| 288 | $classMetadata->addNamedQuery($namedQuery->name, $namedQuery->query); |
|
| 289 | } |
|
| 290 | } |
|
| 291 | ||
| 292 | // Evaluate @EntityListeners annotation |
|
| 293 | if (isset($classAnnotations[Annotation\EntityListeners::class])) { |
|
| @@ 314-328 (lines=15) @@ | ||
| 311 | } |
|
| 312 | ||
| 313 | // Evaluate NamedQueries annotation |
|
| 314 | if (isset($classAnnotations[Annotation\NamedQueries::class])) { |
|
| 315 | $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class]; |
|
| 316 | ||
| 317 | if ( ! is_array($namedQueriesAnnot->value)) { |
|
| 318 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
|
| 319 | } |
|
| 320 | ||
| 321 | foreach ($namedQueriesAnnot->value as $namedQuery) { |
|
| 322 | if ( ! ($namedQuery instanceof Annotation\NamedQuery)) { |
|
| 323 | throw new \UnexpectedValueException("@NamedQueries should contain an array of @NamedQuery annotations."); |
|
| 324 | } |
|
| 325 | ||
| 326 | $classMetadata->addNamedQuery($namedQuery->name, $namedQuery->query); |
|
| 327 | } |
|
| 328 | } |
|
| 329 | ||
| 330 | // Evaluate InheritanceType annotation |
|
| 331 | if (isset($classAnnotations[Annotation\InheritanceType::class])) { |
|