Skip to content

Commit 0965219

Browse files
committed
bug #176 Allow using PHP 8 attributes for doctrine entities (Tobion)
This PR was merged into the main branch. Discussion ---------- Allow using PHP 8 attributes for doctrine entities Fixes #174 If you enable attribute loading for doctrine, those columns of the trait will be missing. By specifying both annotations and attributes in the trait, people can use annotations or attributes in their entities as they wish. ``` doctrine: orm: mappings: App: is_bundle: false type: attribute / annotation dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App ``` Commits ------- b5f4726 Allow using PHP 8 attributes for doctrine entities
2 parents 209eed3 + b5f4726 commit 0965219

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Model/ResetPasswordRequestTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace SymfonyCasts\Bundle\ResetPassword\Model;
1111

12+
use Doctrine\DBAL\Types\Types;
1213
use Doctrine\ORM\Mapping as ORM;
1314

1415
/**
@@ -20,21 +21,25 @@ trait ResetPasswordRequestTrait
2021
/**
2122
* @ORM\Column(type="string", length=20)
2223
*/
24+
#[ORM\Column(type: Types::STRING, length: 20)]
2325
private $selector;
2426

2527
/**
2628
* @ORM\Column(type="string", length=100)
2729
*/
30+
#[ORM\Column(type: Types::STRING, length: 100)]
2831
private $hashedToken;
2932

3033
/**
3134
* @ORM\Column(type="datetime_immutable")
3235
*/
36+
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
3337
private $requestedAt;
3438

3539
/**
3640
* @ORM\Column(type="datetime_immutable")
3741
*/
42+
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
3843
private $expiresAt;
3944

4045
private function initialize(\DateTimeInterface $expiresAt, string $selector, string $hashedToken)

0 commit comments

Comments
 (0)