Skip to content

Commit

Permalink
use attributes for API Platform when using PHP 8+
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Apr 3, 2021
1 parent 0065779 commit 694d720
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Resources/skeleton/doctrine/Entity.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
use Doctrine\ORM\Mapping as ORM;

/**
<?php if ($api_resource): ?> * @ApiResource()
<?php if ($api_resource && !$use_attributes): ?> * @ApiResource()
<?php endif ?>
* @ORM\Entity(repositoryClass=<?= $repository_class_name ?>::class)
<?php if ($should_escape_table_name): ?> * @ORM\Table(name="`<?= $table_name ?>`")
<?php endif ?>
*/
*/<?php if ($api_resource && $use_attributes): ?>
#[ApiResource]
<?php endif ?>
class <?= $class_name."\n" ?>
{
/**
Expand Down

0 comments on commit 694d720

Please sign in to comment.