25 lines
500 B
PHP
25 lines
500 B
PHP
<?php
|
|
|
|
namespace App\Entities\Part;
|
|
|
|
use App\Models\Part\CPUModel;
|
|
|
|
class CPUEntity extends PartEntity
|
|
{
|
|
const PK = CPUModel::PK;
|
|
const TITLE = CPUModel::TITLE;
|
|
//기본기능
|
|
final public function getUsed(): int
|
|
{
|
|
return $this->attributes['used'];
|
|
}
|
|
final public function getStock(): int
|
|
{
|
|
return $this->attributes['stock'];
|
|
}
|
|
final public function getAvailable(): int
|
|
{
|
|
return $this->getStock() - $this->getUsed();
|
|
}
|
|
}
|