<?php

namespace Apexl\Io\File\Entities\Operators;

use Apexl\Io\Exceptions\RecordNotFoundException;
use Apexl\Io\Operators\EntityDatabaseOperator;

class FileOperator extends EntityDatabaseOperator
{
    public function __construct($table, $primaryKey = 'id')
    {
        parent::__construct($table, $primaryKey);
    }

    /**
     * @throws RecordNotFoundException
     */
    public function loadByFileName($fileName): array
    {
        return $this->loadBy('name', $fileName);
    }
}
