Skip to content
Advertisement

Tag: symfony

PHP Symfony Many to Many form

I have a many-to-many relationship between two tables in my database (1 artikel has more than 1 bestelling and vice versa), so I made a link table(bestelregel). But now I want to make a form so that I can add a new order with multiple products, but as I am new to this, I am not sure how to do

Warning: Illegal offset type in isset or empty

I have two Doctrine entities: Page and Synonym. Each Page contains references to several Synonyms, and I want to make sure that no Synonym names are duplicated. So I create a symfony command that runs through the synonyms on a page, checking for duplicates: So far, so good. But when I run my command, I find that the $page->removeSynonym($synonym); line

Annotations in Symfony 4

I try to develop with Symfony 4 so I follow the tutorial on symfony.com I’ve got an error when I try to access at : This is the error : [Syntax Error] Expected PlainValue, got ”’ at position 7 in method AppControllerHomeController::home() in /Users//Documents/ProjetSymfo4/my-project/config/routes/../../src/Controller/ (which is being imported from “/Users//Documents/ProjetSymfo4/my-project/config/routes/annotations.yaml”). Make sure annotations are installed and enabled. I already ran

Creating a Symfony 4 Form without Database

I’m new to symfony and want to to create a simple contact form, take the submitted values and send them as an Email. I don’t want to save anything in the database. I followed the documentation on this page: https://symfony.com/doc/current/form/without_class.html I created a new page/action with the code from the page above: But this gives me an error: What am

Doctrine – Hydrate collection in Entity class

I have a problem regarding a bi-directional OneToMany <-> ManyToOne relationship between my entities Device and Event. This is how mapping looks: The problem comes because Device is a Single Table Inheritance entity and each time I fetch and iterate over some Event entities, then $device is always eagerly fetched. This happens because it’s a STI entity as reported in

Advertisement