Q:

What exactly are entities and Repositories in symfony?

I am developing a new website and REST API in symfony(v4.3),in which I have no experience. There is something that concerns me about the MVC. As you know you put your Controllers in the Controllers folder but what about the Entities and Repositories. I can't define which one of them is the model and where do I build my queries, however I started doing it in the entities.
I have read the documentation and some other forums and articles but there is nothing that can tell me where I should do it.

A:

Entities are the memory objects of one record out of a database-table. For example you could have a User entity that has a property $id, $username, $email and $password. It holds the data from one user. The User entity will store its data into the database-table "user" which has the columns "id", "username", "email" and "password".
The UserRepository will hold all database queries that you can use to retrieve data out of the "user" database-table (and related tables). From your controller you can call a method from the repository class that will run a query and return a result.

