title: Symfony and Domain Driven Design
body: <p>In Symfony 3, how would you differentiate the following based on Domain Driven Design (DDD)?</p>
  
  <ul>
  <li>Service (the one that is defined in config service file)</li>
  <li>Doctrine Repository (\Doctrine\ORM\EntityRepository)</li>
  <li>Entity (a class in entity folder)</li>
  </ul>
  
  <p>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 ?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I try to mock up a scenario below to make my question clearer</p>
  
  <p>A controller has a function to return all available managers for a project</p>
  
  <pre><code>class ManagementController
      public function getAvailableManagers(Array $project)
      {
          ...
      }
  }    
  </code></pre>
  
  <p>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)</p>
  
  <p>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</p>
  
  <p>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?</p>
  
  <pre><code>class ReplacementInstructionRepository extends \Doctrine\ORM\EntityRepository
  {
      private $id;
      private $name;
      private $speciality;
      private $projects;
  }
  </code></pre>
  
  <p>I need a guide on how to split this. Thank you</p>
  
  <p>Cheers,</p>