<?php
namespace App\Entity;
use App\Repository\ActionRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
#[ORM\Entity(repositoryClass: ActionRepository::class)]
class Action
{
use BlameableEntity; //Hook blameable behaviour. Updates createdBy, updatedBy fields
use TimestampableEntity; //Hook timestampable behaviour. Updates createdAt, updatedAt fields
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "IDENTITY")]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'actions')]
#[ORM\JoinColumn(nullable: false)]
private ?ActionType $actionType = null;
#[ORM\ManyToOne]
private ?User $user = null;
#[ORM\ManyToOne]
private ?Product $product = null;
#[ORM\ManyToOne]
private ?Order $order = null;
public function getId(): ?int
{
return $this->id;
}
public function getActionType(): ?ActionType
{
return $this->actionType;
}
public function setActionType(?ActionType $actionType): self
{
$this->actionType = $actionType;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getOrder(): ?Order
{
return $this->order;
}
public function setOrder(?Order $order): self
{
$this->order = $order;
return $this;
}
}