<?php

declare(strict_types=1);

namespace Apexl\Io\Tests\Infrastructure;

use Apexl\Io\Entity;

/**
 * @property int $id
 * @property string $name
 * @property int $test_entity_id
 *
 * @property string $name_twice
 *
 * @method static \Apexl\Io\Tests\Infrastructure\TestEntityFactory factory()
 */
final class TestRelatedEntity extends Entity
{
    static public ?string $tableName;

    public function getTableName(): string
    {
        return TestRelatedEntity::$tableName;
    }

    public static function entityFactoryClass(): string
    {
        return TestRelatedEntityFactory::class;
    }

    protected function definedVirtualFields(): array
    {
        return [
            'name_twice' => 'concat(name,name)'
        ];
    }
}