- Spatie/DataTransferObject 대비
- MapFrom,MapTo -> RawName
- Strict -> 항상
- 심지어 raw type도 더 까다롭게
- array에 MapConverter 적용
- NullIsUndefined 적용
- 빈 nullable arg자리에 null 강제 지정
- Vue3에 v-model.number 지정
- input type="number" 기준
35 lines
554 B
PHP
35 lines
554 B
PHP
<?php
|
|
|
|
namespace sammo\DTO;
|
|
|
|
use sammo\DTO\Attr\NullIsUndefined;
|
|
use sammo\DTO\Attr\RawName;
|
|
|
|
class VoteComment extends DTO
|
|
{
|
|
public function __construct(
|
|
#[NullIsUndefined]
|
|
public ?int $id,
|
|
|
|
#[RawName('vote_id')]
|
|
public int $voteID,
|
|
|
|
#[RawName('general_id')]
|
|
public int $generalID,
|
|
|
|
#[RawName('nation_id')]
|
|
public int $nationID,
|
|
|
|
#[RawName('nation_name')]
|
|
public string $nationName,
|
|
|
|
#[RawName('general_name')]
|
|
public string $generalName,
|
|
|
|
public string $text,
|
|
|
|
public string $date,
|
|
) {
|
|
}
|
|
}
|