M
M
Mir2019-03-16 11:51:06
symfony
Mir, 2019-03-16 11:51:06

Symfony what is a bundle, service, repository?

Do I understand correctly that services are microutilities for solving a specific task,
but when there are a lot of services + route / controller + Entity / Repository, then you get a Bundle? What then is a service container?
And repository are necessary to create methods/functions for the reference to several tables of a DB?
While if the appeal to one table, then it can fit in the entity?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2019-03-16
@mir546

No.
A bundle is a logical group of classes that solves basic tasks with the obligatory possibility of reuse (starting from Symfony 4 this is a depricate approach), for example (email processing, a provider for some kind of storage ...)
Service - can be formulated as you wrote, intended for solving local problems (working with the user, order management, etc.) )
Repository is a class according to the corresponding pattern interact with the database, get or send data from / to the database
Entity is something like a mapper that provides interaction between services and repository

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question