title: Separate Entity from Model or keep them as one class (SpotORM)
body: <p>I am progressively incorporating in my project an ORM (with SpotORM) and dependency injection (with PHP-DI) and I want to do it right. Right now I can't figure out if the Entity and the Model are supposed to be two different classes, or just one.</p>
  
  <p>The Entity class looks like this:</p>
  
  <pre><code>&lt;?php
  
  namespace MyProject\Entity;
  
  use Spot\Entity as Entity;
  
  class Person extends Entity
  {
      protected static $table = "t_person";
  
      public static function fields()
      {
          return [
              "id" =&gt; ["type" =&gt; "integer", "primary" =&gt; true, "autoincrement" =&gt; true],
              "firstname" =&gt; ["type" =&gt; "string", "length" =&gt; 50],
              "lastname" =&gt; ["type" =&gt; "string", "length" =&gt; 50],
          ];
      }
  }
  </code></pre>
  
  <p>This gives me access to <code>firstname</code> with <code>$person-&gt;get("firstname")</code> or <code>$person-&gt;getFirstname()</code>.</p>
  
  <p>I want to create a method <code>getFullName()</code> which returns the first name followed by the last name. My first thought was to write it in this entity class, which works great.</p>
  
  <p>Now I want to use dependency injection for a method like getSlug(), using a Slugifier which comes from a library. But I can't inject it in the constructor because it has a specific signature and is called by SpotORM only.</p>
  
  <p>So I thought I need to have a separate class to put my methods into, but then the ORM doesn't know about it, and for example if I get a list of Person entities from a Organization entity, via a relation, I don't have my additional methods.</p>
  
  <p>What is the usual way to go about this?</p>