With doctrine I am creating an array: From this array I try to remove the object projects: I get the error message that the object is private. I found this post, but there it is written, that I need to write a function inside the class. Removing private properties of object My question is, is it possible to remove it
Tag: symfony
How to add json with fixtures
On symfony I am trying to add some fixtures to the database some of which requires json format. I tried : I tried different other variations but in vain what is the correct way to do it? Answer You need to use the function json_encode to convert it into json. Output: {“France”:29}
Why isn’t InteractiveLoginEvent not fired with Symfony’s 5.1 new security system?
With the new Symfony 5.1 security system, I’m not able to fire the InteractiveLoginEvent. I followed the configuration in the official documentation (here and here) and the system was working …
Shopware : get the document number by its ID
I need to get the documentNumber in the documentRepository by its ID. I am doing a “simple” DAL request to do this but for some reason dumping the output gives empty fields. Here is my subscriber containing the DAL request : Here is my services.xml : I also tried to directly dump the result of the getInvoice() function and this
Symfony – Doctrine filter date if end date is null
I have tricky one, I am trying for days to fix the issue. I have Reports and Subscriptions. I have specified one date for report.. (Report entity has reportDate filed) Idea is to return one result for that specific report day. Then in a query builder, I am triggering Subscriptions table that has startDate and endDate filed. Idea is to
Symfony Forms Error: Entity of type “…” passed to the choice field must be managed. Maybe you forget to persist it in the entity manager
Objective I am trying to make a basic form that signs a new player up for a sport. This is taken from the Symfony example at: https://symfony.com/doc/current/form/dynamic_form_modification.html#form-events-submitted-data The Code I have 3 entities: PlayerList https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/PlayerList.php Sport https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Sport.php Position https://github.com/ChimeraBlack1/Symphart/blob/main/src/Entity/Position.php I have a form: NewPlayerType https://github.com/ChimeraBlack1/Symphart/blob/main/src/Form/NewPlayerType.php I have a controller: NewPlayerController https://github.com/ChimeraBlack1/Symphart/blob/main/src/Controller/NewPlayerController.php The Error: Details: I seem to get this error
Symfony crawler select OPTION in SELECT list without FORM
I am crawling a website that has a SELECT that are freestanding with no FORM parent and no NAME, only ID. I am able to select it with and will open the list, but how can I select a value in the list by value or name ? Answer Try something like and see if it works.
Symfony 5.1 – Dynamically add a CustomType field before submitting
My problem is not that simple I will try to summarize as best as I can. Let’s say I have an entity Vehicle which is related to an entity Engine. Engine entity is an abstract type which is implemented by 2 classes : ElectricEngine and GasEngine. I want to create a form for Vehicle which will create a vehicle and
Symfony, Request cannot find the service [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 1 year ago. Improve this question When I try to run my code I get the following error message : Cannot autowire argument $request of “AppControllerAppController::formulaire()”: it references
Why can I not return a HTTP response from a private function in symfony?
I have a controller working like this’ But I would like to put that response-returning-business already in the private function to clean up my indexAction, but that is not possible, the indexAction will keep going past the point of even if checkOpenEntries attempts to return a HTTP response. Ideally I would like it to look like this, is there a