title: Slim Framework Doctrine json output
body: <p>So I am using Slim Framework and Doctrine, everything is working though I want to return a json response whenever I successfully inserted new data. My code is:</p>
  
  <pre><code>        $now = new \DateTime('now');
          $people-&gt;setCreatedOn($now);
          $people-&gt;setModifiedOn($now);
  
          $people-&gt;setCreatedBy($this-&gt;engine-&gt;getCurrentUser()-&gt;getUserId());
          $people-&gt;setModifiedBy($this-&gt;engine-&gt;getCurrentUser()-&gt;getUserId());
  
  
          $this-&gt;em-&gt;persist($people);
          $this-&gt;em-&gt;flush($people);
  
          $person = $this-&gt;em-&gt;getRepository('App\Entities\EibPerson')-&gt;findOneBy(array('personId' =&gt; $people-&gt;getPersonId()));
          return $response-&gt;withJSON($person-&gt;getArrayCopy());
  </code></pre>
  
  <p>Data is successfully being inserted though Im not seeing any response json. Am I doing something wrong here? </p>