<?php

namespace apexl\Io\modules\file\entities\operators;

use apexl\Io\operators\entityDatabaseOperator;

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

    public function loadByFileName($fileName)
    {
        $entity = $this->vault->select($this->dbTable)->fields()
            ->where('name', $fileName)
            ->execute()
            ->fetchAssoc();
        return ['updateEntityData' => true, 'data' => $entity];
    }
}
