collection-crud/src/Entity/PurchasePrice.php

28 lines
493 B
PHP
Raw Normal View History

2018-07-18 11:35:27 -04:00
<?php declare(strict_types=1);
2017-11-30 15:06:13 -05:00
namespace App\Entity;
2017-11-30 15:06:13 -05:00
2022-02-18 11:34:25 -05:00
use Doctrine\ORM\Mapping as ORM;
2023-07-21 10:35:15 -04:00
trait PurchasePrice {
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: TRUE)]
private ?string $purchasePrice = NULL;
2022-02-18 11:34:25 -05:00
2023-07-21 10:35:15 -04:00
public function setPurchasePrice(?string $purchasePrice): self
{
$this->purchasePrice = $purchasePrice;
2017-11-30 15:06:13 -05:00
2023-07-21 10:35:15 -04:00
return $this;
}
2017-11-30 15:06:13 -05:00
2023-07-21 10:35:15 -04:00
public function getPurchasePrice(): string
{
if (empty($this->purchasePrice))
{
return '0';
}
2017-11-30 15:06:13 -05:00
2023-07-21 10:35:15 -04:00
return $this->purchasePrice;
}
2017-11-30 15:06:13 -05:00
}