In Symfony 3, how would you differentiate the following based on Domain Driven Design (DDD)?
- Service (the one that is defined in config service file)
- Doctrine Repository (\Doctrine\ORM\EntityRepository)
- Entity (a class in entity folder)
I'm aware that doctrine is decoupled from Symfony (i.e. it can be completely omitted). But then which one is the repository in a Symfony project without Doctrine? Or perhaps Symfony (without Doctrine) is actually not really following DDD ?
Edit
I try to mock up a scenario below to make my question clearer
A controller has a function to return all available managers for a project
class ManagementController
public function getAvailableManagers(Array $project)
{
...
}
}
Available managers means that they have no projects on their hand and the project falls within their specialised domain (e.g. customer service, business relations, logistics, etc)
However due to poor design, the speciality domain is not stored in the database but instead needs to be called to a separate HR system via API call. Later on it will be integrated to the database
I would have thought (feel free to correct me) that the Manager should be a repository class because it currently get its information from 2 different sources. The question is ... should I use Doctrine Repository for this? Or maybe it should be just a normal entity or a perhaps a service?
class ReplacementInstructionRepository extends \Doctrine\ORM\EntityRepository
{
private $id;
private $name;
private $speciality;
private $projects;
}
I need a guide on how to split this. Thank you
Cheers,