<?php
namespace App\Entity\OnlineShop;
use App\Entity\AbstractBase;
use App\Repository\OnlineShop\ScaleShippingCostRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Money\Money;
/**
* @ORM\Table(name="vulco_order_scale_shipping_cost")
* @ORM\Entity(repositoryClass=ScaleShippingCostRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
*/
class ScaleShippingCost extends AbstractBase
{
/**
* @ORM\Column(type="money")
*/
private Money $price;
/**
* @ORM\Column(type="integer")
*/
private int $points;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\OnlineShop\Supplier", inversedBy="scaleShippingCosts")
* @ORM\JoinColumn(name="supplier_id", referencedColumnName="id", onDelete="CASCADE")
*/
private Supplier $supplier;
public function getPrice(): Money
{
return $this->price;
}
public function setPrice(Money $price): self
{
$this->price = $price;
return $this;
}
public function getPoints(): int
{
return $this->points;
}
public function setPoints(int $points): self
{
$this->points = $points;
return $this;
}
public function getSupplier(): Supplier
{
return $this->supplier;
}
public function setSupplier(Supplier $supplier): self
{
$this->supplier = $supplier;
return $this;
}
public function __toString(): string
{
return 'Points: '.$this->points.' ยท Price: '.$this->price->getAmount().' '.$this->price->getCurrency()->getCode();
}
}