<?php

declare(strict_types=1);

namespace Apexl\Tests\Core\Infrastructure;

use apexl\Io\includes\Entity;

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

    public function __construct()
    {
        parent::__construct(TestRelatedEntity::$tableName);
    }

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

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