Skip to content
Advertisement

Tag: doctrine

Doctrine – relation of three tables

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,

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

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

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}

Advertisement