Skip to content

Commit

Permalink
Tweak the entity constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Oct 28, 2022
1 parent c512f19 commit fbc76bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Entity/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class Tag implements \JsonSerializable
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function __construct(
#[ORM\Column(type: 'string', unique: true)]
private readonly string $name,
) {
#[ORM\Column(type: 'string', unique: true)]
private readonly string $name;

public function __construct(string $name)
{
$this->name = $name;
}

public function getId(): ?int
Expand Down

0 comments on commit fbc76bb

Please sign in to comment.