Files
exchange-2.0/app/Classes/Modules/Transactions/DataTransferObjects/TransactionDetailObject.php
T
omair saleh 05401f6bbc large commit
2021-03-11 13:06:40 +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 */
private $code;
/** @var string */
private $name;
/** @var int */
private $quantity;
/** @var float */
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();
}
}