title: Symfony 3 error : Case mismatch between loaded and declared class names
body: <p>i've just got this error </p>
  
  <blockquote>
    <p><strong>Case mismatch between loaded and declared class names: MyApp\UserBundle\Entity\post vs MyApp\UserBundle\Entity\Post</strong></p>
  </blockquote>
  
  <p>i'm using two controllers to do a specific operation of delete and getting back to the old page</p>
  
  <p>here is my button's code</p>
  
  <pre><code>&lt;a href="{{ path('DeleteComment',{'idc':comment.id}) }}"&gt;&lt;/a&gt;
                                  &lt;a href="{{ path('DeleteComment',{'idc':comment.id}) }}"&gt; &lt;i
                                              class="icon-trash"&gt;&lt;/i&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>here is my routing's code :</p>
  
  <pre><code>get_view_post:
  path:     /blog/get/one/post/{id}/
  defaults: { _controller: "MyAppBlogBundle:Blog:getpost" }
  DeleteComment:
  path:     /blog/post/comment/delete/{idc}/
  defaults: { _controller: "MyAppBlogBundle:Blog:DeleteComment" }
  </code></pre>
  
  <p>here is my controllers code :</p>
  
  <pre><code>public function DeleteCommentAction($idc)
  {
  
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      $comment = $em-&gt;getRepository('MyAppUserBundle:PostComment')-&gt;find($idc);
      $idPost =$comment-&gt;getIdPost();
  
  
      $em-&gt;remove($comment);
      $em-&gt;flush();
  
  
      return $this-&gt;redirectToRoute("get_view_post", array('id' =&gt; $idPost));
  }
  
  
   public function getpostAction($id)
  {
      $user = $this-&gt;getUser();
      $idu = $user-&gt;getId();
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      $em1 = $this-&gt;getDoctrine()-&gt;getManager();
      $post = $em-&gt;getRepository('MyAppUserBundle:Post')-&gt;find($id);
      $idPost=$post-&gt;getId();
      $comment = $em1-&gt;getRepository('MyAppUserBundle:PostComment')-&gt;findBy(array('idPost' =&gt; $idPost));
      return $this-&gt;render('MyAppBlogBundle::afficherPostAvecComment.html.twig', array('posts' =&gt; $post,'comments'=&gt;$comment,'idu'=&gt;$idu));
  
  }
  </code></pre>
  
  <p>i'm declaring my entities like this :</p>
  
  <pre><code>use MyApp\UserBundle\Entity\Post;
  use MyApp\UserBundle\Entity\PostComment;
  </code></pre>
  
  <p><strong>Here is my Entity</strong></p>
  
  <pre><code>namespace MyApp\UserBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  /**
   * @ORM\Entity
   * @ORM\Table(name="post")
   */
  class Post
  {
  
  
  /**
   * @var integer
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="IDENTITY")
   */
  private $id;
  
  /**
   * @var string
   * @ORM\Column(name="titre", type="string", length=100, nullable=false)
   */
  private $titre;
  /**
   * @var string
   * @ORM\Column(name="contenu", type="string", length=250, nullable=false)
   */
  private $contenu;
  
  /**
   * @var \DateTime
   * @ORM\Column(name="dateajout", type="datetime", nullable=true)
   */
  private $dateajout ;
  
  /**
   * @var integer
   * @ORM\ManyToOne(targetEntity="User")
   * @ORM\JoinColumn(name="id_utilisateur",referencedColumnName="id")
   */
  private $idUser;
  
  /**
   * @var integer
   * @ORM\Column(name="nbLike", type="integer", nullable=true)
   */
  private $nbLike =0;
  /**
   * @var integer
   * @ORM\Column(name="nbDislike", type="integer", nullable=true)
   */
  private $nbDislike=0;
  /**
   * @var integer
   * @ORM\Column(name="nbSignal", type="integer", nullable=true)
   */
  private $nbSignal=0;
  </code></pre>