title: The implementation of deleting from the database does not work, I can not understand why
body: <p>I have an entity to work with the base</p>
  
  <pre><code>class Task
  {
      /**
       * @ORM\Id()
       * @ORM\GeneratedValue()
       * @ORM\Column(type="integer")
       */
      private $id;
  
      /**
       * @ORM\Column(type="string", length=255)
       */
      private $title;
  
      /**
       * @ORM\Column(type="boolean", nullable=true)
       */
      private $status;
  
      public function getId(): ?int
      {
          return $this-&gt;id;
      }
  
      public function getTitle(): ?string
      {
          return $this-&gt;title;
      }
  
      public function setTitle(string $title): self
      {
          $this-&gt;title = $title;
  
          return $this;
      }
  
      public function getStatus(): ?bool
      {
          return $this-&gt;status;
      }
  
      public function setStatus(?bool $status): self
      {
          $this-&gt;status = $status;
  
          return $this;
      }
  }
  </code></pre>
  
  <p>I also have a controller that works with crud of this object.
  In which create, update, read are implemented, but deletion does not work</p>
  
  <pre><code>    /**
       * @Route("/delete/{id}", name="delete_task")
       * @param Task $id
       * @return \Symfony\Component\HttpFoundation\RedirectResponse
       */
      public function delete(Task $id)
      {
          $entityManager = $this-&gt;getDoctrine()-&gt;getManager();
          $entityManager-&gt;remove($id);
          $entityManager-&gt;flush();
  
          return $this-&gt;redirectToRoute('to_do_list');
      }
  </code></pre>
  
  <p>When deleting an object from the list, it produces this error</p>
  
  <p><a href="https://i.stack.imgur.com/XEYjS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XEYjS.png" alt="enter image description here"></a></p>
  
  <p><strong>How to solve this problem.</strong></p>
  
  <p><strong>add</strong>
  <a href="https://i.stack.imgur.com/qCAjL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qCAjL.png" alt="enter image description here"></a></p>