src/Entity/UserWorkroom.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Common\RoleInterface;
  4. use App\Entity\Traits\RoleTrait;
  5. use App\Repository\UserWorkroomRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassUserWorkroomRepository::class)]
  8. class UserWorkroom implements RoleInterface
  9. {
  10.     use RoleTrait;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'userWorkrooms')]
  16.     private $user;
  17.     #[ORM\ManyToOne(targetEntityWorkroom::class, inversedBy'userWorkrooms')]
  18.     #[ORM\JoinColumn(onDelete'CASCADE')]
  19.     private $workroom;
  20.     #[ORM\Column(type'boolean'options: ['default' => 0])]
  21.     private $status;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getUser(): ?User
  27.     {
  28.         return $this->user;
  29.     }
  30.     /**
  31.      * @return $this
  32.      */
  33.     public function setUser(?User $user): self
  34.     {
  35.         $this->user $user;
  36.         return $this;
  37.     }
  38.     public function getWorkroom(): ?Workroom
  39.     {
  40.         return $this->workroom;
  41.     }
  42.     /**
  43.      * @return $this
  44.      */
  45.     public function setWorkroom(?Workroom $workroom): self
  46.     {
  47.         $this->workroom $workroom;
  48.         return $this;
  49.     }
  50.     public function getStatus(): ?bool
  51.     {
  52.         return $this->status;
  53.     }
  54.     public function setStatus(bool $status): self
  55.     {
  56.         $this->status $status;
  57.         return $this;
  58.     }
  59. }