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