I have trouble with writing Doctrine Query Builder. I have a Posts table which is related to the AccountToken table like: I am writing a query builder where I want to pull all the results which are related to that table via UUID and have a specific status. The type value is defined in the AccountToken table. In that table,
Tag: doctrine
disable symfony 5 database connection
I have the default config in my symfonu project I have this line at .env file and I get this error Of course I dont have not isntalled postgres, and I dont need a database for this project, How I cant fix this error I tried to comment the .env file line but I get another error Answer Commenting the
Can I use the same table to represent different Entities in Symfony?
I am migrating an old PHP project to Symfony. I am trying to create the entities based on the existing database schema which I can not change. I am facing a problem : There is a table that would represent two different entities. Basically, there is a boolean (a tinyint(1)), if the boolean is false, then the row of the
Dynamic embedded form with OneToOne relationship
I’m trying to create a form for an article with an addon (tender). The article is in one-to-one relationship with the addon and the addon can be disabled (null). If the checkbox with an addon is checked, the addon needs to be validated, then submitted together with the article. The issue I’m having is, I’m unable to set the addon
alternative for doctrine deprecated ping()
DoctrineDBALConnection::ping() is marked as @deprecated I found this commit that introduced it but no info about successor for this method was given. I would like to know what is expected …
Connection refused to database (Symfony 5) [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I’m trying to connect my database to my app with Symfony but I keep getting errors. I specify that it’s not a local database. Also, I’m
A form can return varying number of values, trying to use the returned values in doctrine query
I have saved a bunch of parsed messages in a db, and I want to be able to pull out results depending on user input. I would like to sort by 1-4 values (more options later on), username, id, email or …
How to add DATE to doctrine query?
I have a date field in Y-m-d H:i:s format. Now user can search by using date only. I have query like this: I have added following lines at my doctrine.yaml file. But I am getting following error: Answer While you could create your own extension to add the DATE function to Doctrine, or download something like beberlei/DoctrineExtensions to do it
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}
Add TINYINT to Doctrine SQL types
Following Symfony doc, I tried to add TINYINT as entity column type. So far it works well, but two problem remain… Each time I want to perform a migration, Doctrine can’t reconize TINYINT for the …