skip to Main Content

Php – How to serialize nested object in symfony

I have the next class #[AssertCascade] class PropertyPromotionDto { public function __construct( private string $name, #[AssertNotBlank(message: 'Не может быть пустым')] private int $value, #[Context([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i'])] private DateTimeImmutable $date, private NestedDto $nestedDto, /** @var NestedDto[] */ private array $nestedDtos,…

VIEW QUESTION

compare two dateTime Objects in PHP (Symfony 7)

#[Route('/show/{id}', name: 'app_warning_show', methods: ['GET'])] public function show(Warning $warning): Response { $time = new DateTime('now'); $this->checkAccess(['ROLE_WHITELIST','ROLE_FRACTION','ROLE_SUPPORT','ROLE_ADMIN']); return $this->render('warning/show.html.twig', [ 'warning' => $warning, 'expired' => $time > $warning->getEnd(), ]); } Created Datetime in DB -> 2024-04-06 12:13:00 Duration are 10h public…

VIEW QUESTION
Back To Top
Search