43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace %NAMESPACE%\%ENTITY_NS%;
|
|
|
|
use Ulmus\{
|
|
Attribute\IndexTypeEnum,
|
|
Attribute\Obj\Table,
|
|
Attribute\Property\Field,
|
|
Attribute\Property\Index,
|
|
Attribute\Property\OrderBy,
|
|
Attribute\Property\Relation,
|
|
Attribute\Property\Virtual,
|
|
Entity\EntityInterface,
|
|
EntityCollection,
|
|
Entity\Field\Datetime,
|
|
Repository,
|
|
SearchRequest,
|
|
};
|
|
|
|
use Ulmus\SearchRequest\Attribute\SearchWhere;
|
|
use Notes\Attribute\Ignore;
|
|
|
|
use %NAMESPACE%\Lib;
|
|
|
|
#[Table(name: "%CLASSNAME_LC%")]
|
|
class %CLASSNAME% implements \JsonSerializable, EntityInterface
|
|
{
|
|
use Lib\EntityTrait;
|
|
|
|
#[Field\Id]
|
|
public int $id;
|
|
|
|
#[Ignore]
|
|
public static function searchRequest(...$arguments) : SearchRequest\SearchRequestInterface
|
|
{
|
|
return new #[SearchRequest\Attribute\SearchRequestParameter(%CLASSNAME%::class)] class(... $arguments) extends SearchRequest\SearchRequest {
|
|
|
|
#[SearchWhere(parameter: [ '%CLASSNAME_LC%_id', 'id' ], source: SearchRequest\Attribute\PropertyValueSource::RequestAttribute)]
|
|
public int $id;
|
|
|
|
};
|
|
}
|
|
} |