Skip to content

Commit

Permalink
use attributes for entity example
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYamous committed Apr 20, 2023
1 parent 57ce0f4 commit 2e0598b
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,32 +125,21 @@ from the `MakerBundle`_:
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity(repositoryClass=UserRepository::class)
*/
#[ORM\Entity(repositoryClass: UserRepository::class)]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @ORM\Column(type="string", length=180, unique=true)
*/
#[ORM\Column(type: 'string', length: 180, unique: true)]
private $email;
/**
* @ORM\Column(type="json")
*/
#[ORM\Column(type: 'json')]
private $roles = [];
/**
* @var string The hashed password
* @ORM\Column(type="string")
*/
#[ORM\Column(type: 'string')]
private $password;
public function getId(): ?int
Expand Down

0 comments on commit 2e0598b

Please sign in to comment.