src/Entity/ShippingScale.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ShippingScaleRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Blameable\Traits\BlameableEntity;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassShippingScaleRepository::class)]
  9. class ShippingScale
  10. {
  11.     use BlameableEntity//Hook blameable behaviour. Updates createdBy, updatedBy fields
  12.     use TimestampableEntity//Hook timestampable behaviour. Updates createdAt, updatedAt fields 
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne(inversedBy'shippingScales')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private ?Shipping $shipping null;
  20.     #[ORM\Column]
  21.     #[Assert\NotNull()]
  22.     #[Assert\PositiveOrZero()]
  23.     private ?float $minWeight null;
  24.     #[ORM\Column]
  25.     #[Assert\NotNull()]
  26.     #[Assert\Positive()]
  27.     private ?float $maxWeight null;
  28.     #[ORM\Column]
  29.     #[Assert\NotNull()]
  30.     #[Assert\PositiveOrZero()]
  31.     private ?float $cost null;
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getShipping(): ?Shipping
  37.     {
  38.         return $this->shipping;
  39.     }
  40.     public function setShipping(?Shipping $shipping): self
  41.     {
  42.         $this->shipping $shipping;
  43.         return $this;
  44.     }
  45.     public function getMinWeight(): ?float
  46.     {
  47.         return $this->minWeight;
  48.     }
  49.     public function setMinWeight(float $minWeight): self
  50.     {
  51.         $this->minWeight $minWeight;
  52.         return $this;
  53.     }
  54.     public function getMaxWeight(): ?float
  55.     {
  56.         return $this->maxWeight;
  57.     }
  58.     public function setMaxWeight(float $maxWeight): self
  59.     {
  60.         $this->maxWeight $maxWeight;
  61.         return $this;
  62.     }
  63.     public function getCost(): ?float
  64.     {
  65.         return $this->cost;
  66.     }
  67.     public function setCost(float $cost): self
  68.     {
  69.         $this->cost $cost;
  70.         return $this;
  71.     }
  72. }