You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
718 B
PHP
34 lines
718 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Kartierung\Analyze\Result;
|
|
|
|
/**
|
|
* @template E of object
|
|
*/
|
|
readonly class EntityResult
|
|
{
|
|
/**
|
|
* @param class-string<E> $classFqcn
|
|
* @param string $tableName
|
|
* @param list<EntityField> $fields
|
|
* @param EntityField $idField
|
|
*/
|
|
public function __construct(
|
|
public string $classFqcn,
|
|
public string $tableName,
|
|
public array $fields,
|
|
public EntityField $idField
|
|
) {}
|
|
|
|
/**
|
|
* @return list<EntityField>
|
|
*/
|
|
public function fieldsWithoutId(): array
|
|
{
|
|
/** @var list<EntityField> */
|
|
return array_filter($this->fields, static fn(EntityField $field) => !$field->isIdField);
|
|
}
|
|
}
|