title: Insert into a symfony 3 table
body: <p>I need to make a simple insertion in the database,</p>
  
  <p>Here is the code in the controller:</p>
  
  <pre><code>    public function verifCreateOrder(Request $req){
          $store = 1;
          $provider =2;
          $creation =  $creation_start = $req-&gt;get('creation_start');
          $delivery = $creation_start = $req-&gt;get('creation_start');
  
          $em = $this-&gt;getDoctrine()-&gt;getManager();
  
          $order = new OrderList();
          $order-&gt;setNumStore($store);
          $order-&gt;setNumProvider($provider);
          $order-&gt;setCreation($creation);
          $order-&gt;setDelivery($delivery);
  
          $em-&gt;persist($order);
          $em-&gt;flush();
          die();
          return $this-&gt;redirectToRoute('search.view');
      }
  </code></pre>
  
  <p>The code of the OrderList entity :</p>
  
  <pre><code>class OrderList
  {
      /**
       * @var int
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var int
       *
       * @ORM\ManyToOne(targetEntity="Provider")
       * @ORM\JoinColumn(name="num_provider", referencedColumnName="id")
       */
      private $numProvider;
  
      /**
       * @var int
       *
       * @ORM\ManyToOne(targetEntity="Store")
       * @ORM\JoinColumn(name="num_store", referencedColumnName="id")
       */
      private $numStore;
  
      /**
       * @return int
       */
      public function getNumStore()
      {
          return $this-&gt;numStore;
      }
  
      /**
       * @param int $numStore
       */
      public function setNumStore($numStore)
      {
          $this-&gt;numStore = $numStore;
      }
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="creation", type="date")
       */
      private $creation;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="delivery", type="date")
       */
      private $delivery;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="last_update", type="date", nullable=true)
       */
      private $lastUpdate;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="emission", type="date", nullable=true)
       */
      private $emission;
  
      /**
       * @var int
       *
       * @ORM\Column(name="reduction_1", type="integer", nullable=true)
       */
      private $reduction1;
  
      /**
       * @var int
       *
       * @ORM\Column(name="reduction_2", type="integer", nullable=true)
       */
      private $reduction2;
  
      /**
       * @var string
       *
       * @ORM\Column(name="comment", type="string", nullable=true, length=255)
       */
      private $comment;
  </code></pre>
  
  <p>Here is the error returned by symfony:</p>
  
  <blockquote>
    <p>Expected value of type "AppBundle\Entity\Provider" for association field "AppBundle\Entity\OrderList#$numProvider", got "integer" instead.</p>
  </blockquote>
  
  <p>Please help me resolve this error.</p>