<?php

namespace App\Entities\Part;

use App\Models\Part\DISKModel;

class DISKEntity extends PartEntity
{
    const PK    = DISKModel::PK;
    const TITLE = DISKModel::TITLE;
    //기본기능    
    public function getStock(): int
    {
        return $this->attributes['stock'];
    }
    public function getFormat(): int
    {
        return intval($this->attributes['format'] ?? 0);
    }
    public function getUsed(): int
    {
        return $this->attributes['used'];
    }
    public function getAvailable(): int
    {
        return $this->getStock() - $this->getUsed() - $this->getFormat();
    }
}
