<?php

declare(strict_types=1);

namespace apexl\Io\modules\file\entities;

use apexl\Io\includes\Entity;

/**
 * @property int $id
 * @property string $entity
 * @property string $entity_id
 * @property int $file_id
 * @property string $file_key
 *
 * @property-read fileEntity $file
 *
 */
class entityFile extends Entity
{
    public final const string TABLE = 'entity__files';

    public function __construct()
    {
        parent::__construct(self::TABLE);
    }

    protected function definedRelations(): array
    {
        return [
            $this->belongsTo('file', fileEntity::class, localKey: 'file', remoteKey: 'id'),
        ];
    }
}
