29 lines
532 B
PHP
29 lines
532 B
PHP
|
<?php
|
||
|
|
||
|
namespace CameraBundle\Entity;
|
||
|
|
||
|
trait PurchasePriceTrait {
|
||
|
/**
|
||
|
* Set purchasePrice
|
||
|
*
|
||
|
* @param string $purchasePrice
|
||
|
*
|
||
|
* @return Camera
|
||
|
*/
|
||
|
public function setPurchasePrice($purchasePrice)
|
||
|
{
|
||
|
$this->purchasePrice = $purchasePrice ?? null;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get purchasePrice
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getPurchasePrice()
|
||
|
{
|
||
|
return (double) str_replace(['$',','], '', (string)$this->purchasePrice) ?? null;
|
||
|
}
|
||
|
}
|