Files
2021-04-12 14:44:05 +08:00

73 lines
1.3 KiB
PHP

<?php
namespace App\Classes\Modules\Transactions\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class TransactionDetailObject implements DataTransferObject
{
/** @var string|null */
private $code;
/** @var string|null */
private $name;
/** @var int|null */
private $quantity;
/** @var float|null */
private $price;
/**
* TransactionDetailObject constructor.
* @param string $code
* @param string $name
* @param int $quantity
* @param float $price
*/
public function __construct(?string $code, ?string $name , ?int $quantity, ?float $price)
{
$this->code = $code;
$this->name = $name;
$this->quantity = $quantity;
$this->price = $price;
}
/**
* @return string
*/
public function getCode(): ?string
{
return $this->code;
}
/**
* @return string
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @return int
*/
public function getQuantity(): ?int
{
return $this->quantity;
}
/**
* @return float
*/
public function getPrice(): ?float
{
return $this->price;
}
public function getAmount(): float
{
return $this->getQuantity() * $this->getPrice();
}
}