Answer the question
In order to leave comments, you need to log in
Entity and Repository - difference?
I started to dig into the project, I saw that there is work with the doctrine, Repository, Entity.
As I understand it, requests are mostly made in repositories, and entity simply describes the structure of the table? (I saw there columns like
private $id; ... and with some kind of annotations.
In general, in simple, human language, why do we need repositories and entities?
Answer the question
In order to leave comments, you need to log in
In simple terms (in fact, a little more complicated):
Entity is an entity, displaying one record in the database.
Reepository is a class for working with a table in a database, as an example, CRUD operations.
This separation allows you to implement the principle of single responsibility and makes the code a little better (compared to ActiveRecord, for example).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question