My real problem is that I am sending an Ajax Jquery Request to an API of mine, the server response is ‘Argument #1 of ::setDate() must be DateTimeInterface, string given’ I tried to cast but it was useless. My Ajax at JQUERY: My API at PHP (Symfony’s controller): The Object I’m sending: Answer Your entity Distribucion probably has a setter
Tag: symfony
How to get human friendly format time zone offset (PHP)
Help me to decide this task, please. (PHP, Symfony) What I have: List of time zone like In result I want to see: What I did: And if I dump $humanFriendlyOffset I get only digital value like this: 0, 1, -7, 2, 1.5 Question: Is something prepared method in PHP/Symfony to convert 1 -> +01:00, -7 -> -07:00, 2 ->
Symfony – How do I get services dynamically from the container?
For an API project I want to fail very early, before the controller is dispatched, if the input data is incorrect. I’ve managed to get the validation done by using the route defaults and an event subscriber subscribing to the KernelEvents::REQUEST event. As you can see in the code, I’m trying to get the validator from the container. My assumption
Symfony errors not returned through Airflow
So here is my problem: airflow, Since executes a Python file that calls a php script (Symfony) to perform a created command. The command itself works fine. The execution of the latter from Airflow also works very well (with the visual display of Airflow: runs success). When I cause an error in the symfony command (exit(1), throw,…), to see how
Doctrine “Entity” is not a valid entity or mapped super class
In my doctrine.php I have the following configuration And my Entity class is defined as follows I tried accessing it like by calling getRepository like this But this fails with the is not a valid entity or mapped super class P.S. If necessary, this is my EntityRepository.php Answer I found an issue. I am a dummy.. I had to change
Symfony Entites vs CollectionType
I have the following problem with Symfony. I made 3 entities: Customer, Cart, and CartItem. And what I want, is to display all the Products that are inside Cart (These are inside Cart Item), and to be able to change quantity on ever single one with some kind of form. The best way is to use CollectionType, but I get
Symfony6 – add iput field after submitting form
i have an ChoiceType::class input field in my form with, now just as an example, two choices: ‘choices’ => [‘type1’ => ‘1’, ‘type2’ => ‘2’] now when the user select type2 i want to add an exta TextType::class inputfield to the form. But i dont want to show the input field before and i want it to be required if
Symfony – Undefined type ‘DoctrineORMMappingEntity
I got many errors similar to this in topic after created entities. Dont’t know why cuz use tag seems correct. Using symfony 6.1. Here is my model: Answer Instead of this try that
Symfony 6 – How to access properties of object of specific ID
I have two entities – one is Product, second – Order. I’ve created controllers to navigate between page of ProductController that lists the whole ProductRepository to the page of OrderController, which should: take a Product ID to show its properties on the Order page (name and price) have a form with quantity and “customer’s” email to be added to the
Mercure issues with changing JWT secret key
im having problem with my Mercure App, Im running via docker-compose image of mercure: and in section with MERCURE_PUBLISHER_JWY_KEY and subscriber key im having it set by default to !ChangeMe! and it is working as it should. And my subscriber in Vue is working when sign part of JWT is !ChangeMe! eg: But I want to make it secure, so