src/Entity/Action.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ActionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Blameable\Traits\BlameableEntity;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. #[ORM\Entity(repositoryClassActionRepository::class)]
  8. class Action
  9. {
  10.     use BlameableEntity//Hook blameable behaviour. Updates createdBy, updatedBy fields
  11.     use TimestampableEntity//Hook timestampable behaviour. Updates createdAt, updatedAt fields 
  12.     
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne(inversedBy'actions')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private ?ActionType $actionType null;
  20.     #[ORM\ManyToOne]
  21.     private ?User $user null;
  22.     #[ORM\ManyToOne]
  23.     private ?Product $product null;
  24.     #[ORM\ManyToOne]
  25.     private ?Order $order null;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getActionType(): ?ActionType
  31.     {
  32.         return $this->actionType;
  33.     }
  34.     public function setActionType(?ActionType $actionType): self
  35.     {
  36.         $this->actionType $actionType;
  37.         return $this;
  38.     }
  39.     public function getUser(): ?User
  40.     {
  41.         return $this->user;
  42.     }
  43.     public function setUser(?User $user): self
  44.     {
  45.         $this->user $user;
  46.         return $this;
  47.     }
  48.     public function getProduct(): ?Product
  49.     {
  50.         return $this->product;
  51.     }
  52.     public function setProduct(?Product $product): self
  53.     {
  54.         $this->product $product;
  55.         return $this;
  56.     }
  57.     public function getOrder(): ?Order
  58.     {
  59.         return $this->order;
  60.     }
  61.     public function setOrder(?Order $order): self
  62.     {
  63.         $this->order $order;
  64.         return $this;
  65.     }
  66. }