File tree 2 files changed +3
-2
lines changed
Resources/skeleton/doctrine
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public function regenerateEntities(string $classOrNamespace): void
44
44
{
45
45
try {
46
46
$ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace );
47
- } catch (MappingException | LegacyCommonMappingException | PersistenceMappingException $ mappingException ) {
47
+ } catch (MappingException | LegacyCommonMappingException | PersistenceMappingException $ mappingException ) {
48
48
$ metadata = $ this ->doctrineHelper ->getMetadata ($ classOrNamespace , true );
49
49
}
50
50
Original file line number Diff line number Diff line change 2
2
3
3
namespace <?= $ namespace ?> ;
4
4
5
- <?php if ($ api_resource ): ?> use ApiPlatform\Core\Annotation\ApiResource;
5
+ <?php if ($ api_resource && class_exists (\ApiPlatform \Metadata \ApiResource::class)): ?> use ApiPlatform\Metadata\ApiResource;
6
+ <?php elseif ($ api_resource ): ?> use ApiPlatform\Core\Annotation\ApiResource;
6
7
<?php endif ?>
7
8
use <?= $ repository_full_class_name ?> ;
8
9
use Doctrine\ORM\Mapping as ORM;
You can’t perform that action at this time.
0 commit comments