title: Doctrine ORM and slim php - Adding a class manually for an newly created table
body: <p>I'm working on a legacy app, and this is my first time using doctrine (normally a rails guy).</p>
  
  <p>I manually created a new table on the db called "SNACKS" (naming convention was all caps).</p>
  
  <p>I created a models/entities/Snack.dcm.yaml file:</p>
  
  <pre><code>Snack:
      type: entity
      table: SNACKS
      fields:
          id:
              id: true
              type: integer
              unsigned: false
              nullable: false
              generator:
                  strategy: IDENTITY
          patient_id:
              type: integer
              unsigned: false
              nullable: false
          snack_name:
              type: string
              length: 50
              fixed: false
              nullable: false
          created_at:
              type: datetime
              nullable: false
          updated_at:
              type: datetime
              nullable: false
      lifecycleCallbacks: {  }
  </code></pre>
  
  <p>But still get this error: <code>[Semantical Error] line 0, col 14 near 'Snack s': Error: Class 'Snack' is not defined.</code></p>
  
  <p>I also noticed there were some files in the model dir "model/" and copied that over as well:</p>
  
  <pre><code>&lt;?php
  
  
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * Snacks
   */
  class Snack
  {
      /**
       * @var integer
       */
      private $id;
  
      /**
       * @var integer
       */
      private $patient_id;
  
      /**
       * @var text
       */
      private $snack_name;
  
      /**
       * @var datetime
       */
      private $created_at;
  
      /**
       * @var datetime
       */
      private $updated_at;
  
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getPatientId()
      {
          return $this-&gt;patient_id;
      }
  
  
      public function setPatientId($patient_id)
      {
              $this-&gt;patient_id = $patient_id;
          return $this-&gt;patient_id;
      }
  
      /**
       * Set name
       *
       * @param string $name
       * @return Medicines
       */
      public function setSnackName($name)
      {
          $this-&gt;snack_name = $name;
  
          return $this;
      }
  
      /**
       * Get name
       *
       * @return string 
       */
      public function getSnackName()
      {
          return $this-&gt;snack_name;
      }
  
      /**
       * Set generic
       *
       * @param string $generic
       * @return Medicines
       */
      public function setCreatedAt($datetime)
      {
          $this-&gt;created_at = $datetime;
  
          return $this;
      }
  
      /**
       * Get generic
       *
       * @return string 
       */
      public function getCreatedAt()
      {
          return $this-&gt;created_at;
      }
  
      /**
       * Set contraInd
       *
       * @param string $contraInd
       * @return Medicines
       */
      public function setUpdatedAt($datetime)
      {
          $this-&gt;updated_at = $datetime;
  
          return $this;
      }
  }
  </code></pre>
  
  <ul>
  <li>note the comments are wrong in that because I copied it from an existing file and changed what I needed.</li>
  </ul>
  
  <p>Any ideas why Doctrine is not finding the class?</p>