skip to Main Content

Php – Call method with autowired parameter

I want to call service method dynamically with autowired parameters for now I do as followed : $result = call_user_func_array([$myService,"myMethod"],[$entityManager,$tranlator]); The problem is that sometimes the service method needs other parameters than $entityManager and $translator. I would like to call…

VIEW QUESTION

Php – How to map a date from a query string?

I have a symfony API endpoint that goes like this: /orders/list-all?since=2024-10-21 I'd like to map that query string parameter to a DateTimeImmutable (or DateTimeInterface), like so: public function listOrders( #[OAQueryParameter(name: 'since', in: 'query', description: 'Date de début de la recherche',…

VIEW QUESTION

Php – Symfony serializer with array of entities

I have 2 DTO objects and I need to convert json to it: class SomeDTO { public function __construct( #[SerializedName('some_property')] private string $someProperty, #[SerializedName('some_other_property')] private int $someOtherProperty, ) { } public function getSomeProperty(): string { return $this->someProperty; } public function…

VIEW QUESTION

Phpmyadmin – Can't install Sylius starter project

I'd like to create a Sylius project but I can't install the initial project following the instructions in the documentation. the command compose compose create-project sylius/sylius-standard MyFirstShop works but when I create .env.local which contains : DATABASE_URL=mysql://root@localhost/my_project?serverVersion=8 then I run…

VIEW QUESTION
Back To Top
Search