title: magic finder not working when i add a OneToMany association to an entity (Doctrine 2)
body: <p>After i added a OneToMany Association to my Entity , the magic finder and any means to get results from database has stopped and i get A FATAL ERROR.</p>
  
  <p>here's the first entity (Slaplans):</p>
  
  <pre><code>namespace ZC\Entity;
  use Doctrine\Common\Collections\ArrayCollection;
  use ZC\Entity\Slaholidaylinks;
  /**
   * Slaplans
   *
   * @Table(name="slaplans")
   * @Entity(repositoryClass="Repositories\Slaplans")
   */
  class Slaplans
  {
      /**
       * @var integer $slaplanid
       *
       * @Column(name="slaplanid", type="integer", nullable=false)
       * @Id
       * @GeneratedValue(strategy="IDENTITY")
       */
      private $slaplanid;
  
      /**
       * @var integer $slascheduleid
       *
       * @Column(name="slascheduleid", type="integer", nullable=false)
       */
      private $slascheduleid;
  
      /**
       * @var string $title
       *
       * @Column(name="title", type="string", length=255, nullable=false)
       */
      private $title;
  
      /**
       * @var float $overduehrs
       *
       * @Column(name="overduehrs", type="float", nullable=false)
       */
      private $overduehrs;
  
      /**
       * @var float $resolutionduehrs
       *
       * @Column(name="resolutionduehrs", type="float", nullable=false)
       */
      private $resolutionduehrs;
  
      /**
       * @var smallint $isenabled
       *
       * @Column(name="isenabled", type="smallint", nullable=false)
       */
      private $isenabled;
  
      /**
       * @var integer $sortorder
       *
       * @Column(name="sortorder", type="integer", nullable=false)
       */
      private $sortorder;
  
      /**
       * @var smallint $ruletype
       *
       * @Column(name="ruletype", type="smallint", nullable=false)
       */
      private $ruletype;
  
      /**
       * @var integer $dateline
       *
       * @Column(name="dateline", type="integer", nullable=false)
       */
      private $dateline;
  
      /**
       * @OneToMany(targetEntity="Slaholidaylinks" , mappedBy="planid", cascade={"persist"} )
       */
      private $holidaylinks;
  
      public function __construct(){
  
          $this-&gt;holidaylinks= new ArrayCollection();
              }
  
      /**
       * Get slaplanid
       *
       * @return integer $slaplanid
       */
      public function getSlaplanid()
      {
          return $this-&gt;slaplanid;
      }
  
      /**
       * Set slascheduleid
       *
       * @param integer $slascheduleid
       */
      public function setSlascheduleid($slascheduleid)
      {
          $this-&gt;slascheduleid = $slascheduleid;
      }
  
      /**
       * Get slascheduleid
       *
       * @return integer $slascheduleid
       */
      public function getSlascheduleid()
      {
          return $this-&gt;slascheduleid;
      }
  
      /**
       * Set title
       *
       * @param string $title
       */
      public function setTitle($title)
      {
          $this-&gt;title = $title;
      }
  
      /**
       * Get title
       *
       * @return string $title
       */
      public function getTitle()
      {
          return $this-&gt;title;
      }
  
      /**
       * Set overduehrs
       *
       * @param float $overduehrs
       */
      public function setOverduehrs($overduehrs)
      {
          $this-&gt;overduehrs = $overduehrs;
      }
  
      /**
       * Get overduehrs
       *
       * @return float $overduehrs
       */
      public function getOverduehrs()
      {
          return $this-&gt;overduehrs;
      }
  
      /**
       * Set resolutionduehrs
       *
       * @param float $resolutionduehrs
       */
      public function setResolutionduehrs($resolutionduehrs)
      {
          $this-&gt;resolutionduehrs = $resolutionduehrs;
      }
  
      /**
       * Get resolutionduehrs
       *
       * @return float $resolutionduehrs
       */
      public function getResolutionduehrs()
      {
          return $this-&gt;resolutionduehrs;
      }
  
      /**
       * Set isenabled
       *
       * @param smallint $isenabled
       */
      public function setIsenabled($isenabled)
      {
          $this-&gt;isenabled = $isenabled;
      }
  
      /**
       * Get isenabled
       *
       * @return smallint $isenabled
       */
      public function getIsenabled()
      {
          return $this-&gt;isenabled;
      }
  
      /**
       * Set sortorder
       *
       * @param integer $sortorder
       */
      public function setSortorder($sortorder)
      {
          $this-&gt;sortorder = $sortorder;
      }
  
      /**
       * Get sortorder
       *
       * @return integer $sortorder
       */
      public function getSortorder()
      {
          return $this-&gt;sortorder;
      }
  
      /**
       * Set ruletype
       *
       * @param smallint $ruletype
       */
      public function setRuletype($ruletype)
      {
          $this-&gt;ruletype = $ruletype;
      }
  
      /**
       * Get ruletype
       *
       * @return smallint $ruletype
       */
      public function getRuletype()
      {
          return $this-&gt;ruletype;
      }
  
      /**
       * Set dateline
       *
       * @param integer $dateline
       */
      public function setDateline($dateline)
      {
          $this-&gt;dateline = $dateline;
      }
  
      /**
       * Get dateline
       *
       * @return integer $dateline
       */
      public function getDateline()
      {
          return $this-&gt;dateline;
      }
  
      /*
       * Get Holiday links
       * @return ArrayCollection $holidaylinks
       */
      public function getHolidaylinks()
      {
          return $this-&gt;holidaylinks;
      }
  /*
      public function addHolidaylinks(Slaholidaylinks $aholidaylink)
      {
          $this-&gt;holidaylinks[]=$aholidaylink;
      }*/
  
  }
  
  
      /**
       * @var string $title
       *
       * @Column(name="title", type="string", length=255, nullable=false)
       */
      private $title;
  
      /**
       * @var float $overduehrs
       *
       * @Column(name="overduehrs", type="float", nullable=false)
       */
      private $overduehrs;
  
      /**
       * @var float $resolutionduehrs
       *
       * @Column(name="resolutionduehrs", type="float", nullable=false)
       */
      private $resolutionduehrs;
  
      /**
       * @var smallint $isenabled
       *
       * @Column(name="isenabled", type="smallint", nullable=false)
       */
      private $isenabled;
  
      /**
       * @var integer $sortorder
       *
       * @Column(name="sortorder", type="integer", nullable=false)
       */
      private $sortorder;
  
      /**
       * @var smallint $ruletype
       *
       * @Column(name="ruletype", type="smallint", nullable=false)
       */
      private $ruletype;
  
      /**
       * @var integer $dateline
       *
       * @Column(name="dateline", type="integer", nullable=false)
       */
      private $dateline;
  
      /**
       * @OneToMany(targetEntity="Slaholidaylinks" , mappedBy="planid", cascade={"persist"} )
       */
      private $holidaylinks;
  
      public function __construct(){
  
          $this-&gt;holidaylinks= new ArrayCollection();
              }
  
      /**
       * Get slaplanid
       *
       * @return integer $slaplanid
       */
      public function getSlaplanid()
      {
          return $this-&gt;slaplanid;
      }
  
      /**
       * Set slascheduleid
       *
       * @param integer $slascheduleid
       */
      public function setSlascheduleid($slascheduleid)
      {
          $this-&gt;slascheduleid = $slascheduleid;
      }
  
      /**
       * Get slascheduleid
       *
       * @return integer $slascheduleid
       */
      public function getSlascheduleid()
      {
          return $this-&gt;slascheduleid;
      }
  
      /**
       * Set title
       *
       * @param string $title
       */
      public function setTitle($title)
      {
          $this-&gt;title = $title;
      }
  
      /**
       * Get title
       *
       * @return string $title
       */
      public function getTitle()
      {
          return $this-&gt;title;
      }
  
      /**
       * Set overduehrs
       *
       * @param float $overduehrs
       */
      public function setOverduehrs($overduehrs)
      {
          $this-&gt;overduehrs = $overduehrs;
      }
  
      /**
       * Get overduehrs
       *
       * @return float $overduehrs
       */
      public function getOverduehrs()
      {
          return $this-&gt;overduehrs;
      }
  
      /**
       * Set resolutionduehrs
       *
       * @param float $resolutionduehrs
       */
      public function setResolutionduehrs($resolutionduehrs)
      {
          $this-&gt;resolutionduehrs = $resolutionduehrs;
      }
  
      /**
       * Get resolutionduehrs
       *
       * @return float $resolutionduehrs
       */
      public function getResolutionduehrs()
      {
          return $this-&gt;resolutionduehrs;
      }
  
      /**
       * Set isenabled
       *
       * @param smallint $isenabled
       */
      public function setIsenabled($isenabled)
      {
          $this-&gt;isenabled = $isenabled;
      }
  
      /**
       * Get isenabled
       *
       * @return smallint $isenabled
       */
      public function getIsenabled()
      {
          return $this-&gt;isenabled;
      }
  
      /**
       * Set sortorder
       *
       * @param integer $sortorder
       */
      public function setSortorder($sortorder)
      {
          $this-&gt;sortorder = $sortorder;
      }
  
      /**
       * Get sortorder
       *
       * @return integer $sortorder
       */
      public function getSortorder()
      {
          return $this-&gt;sortorder;
      }
  
      /**
       * Set ruletype
       *
       * @param smallint $ruletype
       */
      public function setRuletype($ruletype)
      {
          $this-&gt;ruletype = $ruletype;
      }
  
      /**
       * Get ruletype
       *
       * @return smallint $ruletype
       */
      public function getRuletype()
      {
          return $this-&gt;ruletype;
      }
  
      /**
       * Set dateline
       *
       * @param integer $dateline
       */
      public function setDateline($dateline)
      {
          $this-&gt;dateline = $dateline;
      }
  
      /**
       * Get dateline
       *
       * @return integer $dateline
       */
      public function getDateline()
      {
          return $this-&gt;dateline;
      }
  
      /*
       * Get Holiday links
       * @return ArrayCollection $holidaylinks
       */
      public function getHolidaylinks()
      {
          return $this-&gt;holidaylinks;
      }
  /*
      public function addHolidaylinks(Slaholidaylinks $aholidaylink)
      {
          $this-&gt;holidaylinks[]=$aholidaylink;
      }*/
  
  }
  </code></pre>
  
  <p>here's the second Entity (Slaholidaylinks):</p>
  
  <pre><code>&lt;?php
  namespace ZC\Entity;
  use Doctrine\Common\Collections\ArrayCollection;
  use ZC\Entity\Slaplans;
  
  /**
   * Slaholidaylinks
   *
   * @Table(name="slaholidaylinks")
   * @Entity(repositroyClass="Repositories\Slaholidaylinks")
   */
  class Slaholidaylinks
  {
      /**
       * @var integer $slaholidaylinkid
       *
       * @Column(name="slaholidaylinkid", type="integer", nullable=false)
       * @Id
       * @GeneratedValue(strategy="IDENTITY")
       */
      private $slaholidaylinkid;
  
      /**
       * @var Slaplans $slaholidayid
       * @ManyToOne(targetEntity="Slaplans" , inversedBy="holidaylinks" )
       * @JoinColumn(name='slaplanid',referencedColumnName='slaplanid')
       */
      private $slaplanid;
  
      /**
       * @var integer $slaholidayid
       *
       * @Column(name="slaholidayid", type="integer", nullable=false)
       */
      private $slaholidayid;
  
  
      /**
       * Get slaholidaylinkid
       *
       * @return integer $slaholidaylinkid
       */
      public function getSlaholidaylinkid()
      {
          return $this-&gt;slaholidaylinkid;
      }
  
      /**
       * Set slaplanid
       *
       * @param integer $slaplanid
       */
      public function setSlaplanid(Slaplans $slaplanid)
      {
          $this-&gt;slaplanid = $slaplanid;
      }
  
      /**
       * Get slaplanid
       *
       * @return integer $slaplanid
       */
      public function getSlaplanid()
      {
          return $this-&gt;slaplanid;
      }
  
      /**
       * Set slaholidayid
       *
       * @param integer $slaholidayid
       */
      public function setSlaholidayid($slaholidayid)
      {
          $this-&gt;slaholidayid = $slaholidayid;
      }
  
      /**
       * Get slaholidayid
       *
       * @return integer $slaholidayid
       */
      public function getSlaholidayid()
      {
          return $this-&gt;slaholidayid;
      }
  }
  </code></pre>
  
  <p>where i try to get a Slaplans Entity using the following code i get a fatal error:</p>
  
  <p>$default=$this->_em->getRepository('ZC\Entity\Slaplans')->findOneBySlaplanid($planid);</p>
  
  <p>I tried the queryBuilder but i get an error also when i run the getResult function.</p>
  
  <p>Please help me .</p>