title: Variables from Android are always null in Symfony
body: <p>I'm programming an API RESTful (FosRestBundle) in Symfony3 for Android. I pass values from Android with classes that inherit from StringRequest.</p>
  
  <pre><code>public class CommandActivity extends AppCompatActivity {
  
  protected TextView tvDrink;
  protected TextView tvFood;
  protected TextView tvTotalprice;
  protected Button btAccept;
  protected Button btCancel;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_command);
  
  
      //Recuperamos los arrays que nos ha pasado MainActivity
      Intent intent = getIntent();
  
      final ArrayList&lt;String&gt; namecomfoods = intent.getStringArrayListExtra("namecomfoods");
      final ArrayList&lt;Integer&gt; amountfoods = intent.getIntegerArrayListExtra("amountfoods");
      final ArrayList&lt;String&gt; namecomdrinks = intent.getStringArrayListExtra("namecomdrinks");
      final ArrayList&lt;Integer&gt; amountdrinks = intent.getIntegerArrayListExtra("amountdrinks");
  
      final String Sum = intent.getStringExtra("Sum");
      final int idtable = intent.getIntExtra("idtable", 0);
      final int iduser = intent.getIntExtra("iduser", 0);
  
      final LinearLayout linearLayout = new LinearLayout(this);
      linearLayout.setOrientation(LinearLayout.VERTICAL);
  
  
      tvDrink = (TextView) findViewById(R.id.tvDrink);
      tvFood = (TextView) findViewById(R.id.tvFood);
      tvTotalprice = (TextView) findViewById(R.id.tvTotalprice);
      btAccept = (Button)findViewById(R.id.btAccept);
      btCancel = (Button)findViewById(R.id.btCancel);
  
      for(int i = 0; i &lt; namecomdrinks.size(); i++) {
          tvDrink.append(amountdrinks.get(i)+" "+namecomdrinks.get(i));
          tvDrink.append("\n");
  
      }
      tvDrink.setMovementMethod(new ScrollingMovementMethod());
  
      for(int i = 0; i &lt; namecomfoods.size(); i++) {
          tvFood.append(amountfoods.get(i)+" "+namecomfoods.get(i));
          tvFood.append("\n");
      }
  
      tvFood.setMovementMethod(new ScrollingMovementMethod());
  
      tvTotalprice.setText("Total: "+Sum);
  
      //Presionamos botón Aceptar
      btAccept.setOnClickListener(new View.OnClickListener()
      {
          @Override
          public void onClick(View view)
          {
  
              // Respuesta que recibimos del servidor
              Response.Listener&lt;String&gt; responseListener = new Response.Listener&lt;String&gt;()
              {
                  @Override
                  public void onResponse(String response)
                  {
                      try {
                          JSONObject jsonResponse = new JSONObject(response);
                          boolean success = jsonResponse.getBoolean("success");
  
                          if (success)
                          {
                              AlertDialog.Builder builder = new AlertDialog.Builder(CommandActivity.this);
                              builder.setMessage("Pedido lanzado a cocina")
                                      .setNegativeButton("de acuerdo", null)
                                      .create()
                                      .show();
                          } else {
                              AlertDialog.Builder builder = new AlertDialog.Builder(CommandActivity.this);
                              builder.setMessage("Error al procesar el pedido")
                                      .setNegativeButton("Intenta de nuevo", null)
                                      .create()
                                      .show();
                          }
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              };
              String expense = Sum.replace("€","");
              RegcommandRequest regcommandRequest = new RegcommandRequest(expense,idtable,iduser,responseListener);
              RequestQueue queue = Volley.newRequestQueue(CommandActivity.this);
              queue.add(regcommandRequest);
          }
      }
      );
  
      //Presionamos botón Cancelar
      btCancel.setOnClickListener(new View.OnClickListener()
      {
          @Override
          public void onClick(View view)
          {
              finish();
          }
      });
  }
  }
  </code></pre>
  
  <p>RegcommandRequest class:</p>
  
  <pre><code>public class RegcommandRequest extends StringRequest
  {
      private static final ConvertUrl convurl = new ConvertUrl();
      private static final String REG_COMMAND_URL = convurl.ConvertUrl("regcommand");
  
  private Map&lt;String, String&gt; params;
  
  public RegcommandRequest(String expense,int idtable, int iduser, Response.Listener&lt;String&gt; listener)
  {
      super(Method.POST, REG_COMMAND_URL, listener, null);
      params = new HashMap&lt;&gt;();
      params.put("Sum",String.valueOf(expense));
      params.put("idtable", String.valueOf(idtable));
      params.put("iduser", String.valueOf(iduser));
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>expense, idtable and iduser are always null in Symfony. However if i debug the android app the values are passed correctly. I don't understand!!
  I tried to do with differentes methods</p>
  
  <pre><code>$table = $em-&gt;getRepository('AppBundle:Table_')-&gt;find($idtable);
  </code></pre>
  
  <p>And dev.log shows me</p>
  
  <pre><code>request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMException: "The identifier id is missing for a query of AppBundle\Entity\Table_" at /opt/lampp/htdocs/ebar11/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 294 {"exception":"[object] (Doctrine\\ORM\\ORMException(code: 0): The identifier id is missing for a query of AppBundle\\Entity\\Table_ at /opt/lampp/htdocs/ebar11/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:294)"} []
  </code></pre>
  
  <p>and too</p>
  
  <pre><code>$qb = $em-&gt;createQueryBuilder();
  
      $table = $qb-&gt;select('t')
                   -&gt;from('AppBundle:Table_', 't')
                  -&gt;where("t.id = '$idtable'")
                   -&gt;getQuery()
                   -&gt;getResult();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$table = $em-&gt;getRepository('AppBundle:Table_')-&gt;findOneById($idtable);
  </code></pre>
  
  <p>and dev.log shows me</p>
  
  <pre><code>doctrine.DEBUG: SELECT t0_.id AS id_0, t0_.number AS number_1, t0_.location AS location_2, t0_.sun AS sun_3, t0_.state AS state_4, t0_.nchair AS nchair_5, t0_.Bar_id AS Bar_id_6 FROM Table_ t0_ WHERE t0_.id = '' [] []
  </code></pre>
  
  <p>The controller method in Symfony</p>
  
  <pre><code>    /**
   * @Post("/api/regcommand.{_format}", defaults={"_format"="json"}, options={"expose"=true}, name="api_regcommand")
   * @View()
   */
  public function regcommandAction(Request $request)
  {
      // Recuperamos los datos que nos envían desde la aplicación android
      $expense = $request-&gt;request-&gt;get('expense');
      $idtable = $request-&gt;request-&gt;get('idtable'); 
      $iduser = $request-&gt;request-&gt;get('iduser');
  
  
      //Creamos objeto gestor de entidades responsable del manejo de la bbdd
      $em = $this-&gt;getDoctrine()-&gt;getManager();
      //$em-&gt;getConnection()-&gt;getConfiguration()-&gt;setSQLLogger(null);
  
      //$em-&gt;getConnection()-&gt;getConfiguration()-&gt;setSQLLogger(null);       
      //Establecemos la fecha de inicio
      $startdate = new \DateTime();
      //Establecemos estado del pedido (start/progress/final/kill)
      $statecommand = "start";
  
      //Buscamos las mesa
      //$table = $em-&gt;getRepository('AppBundle:Table_')-&gt;find($idtable);
      $table = $em-&gt;getRepository('AppBundle:Table_')-&gt;findOneBy(array('id' =&gt; $idtable));
  
      /*$qb = $em-&gt;createQueryBuilder();
  
      $table = $qb-&gt;select('t')
                   -&gt;from('AppBundle:Table_', 't')
                  -&gt;where("t.id = '$idtable'")
                   -&gt;getQuery()
                   -&gt;getResult();*/
  
      if (!$table)
      {
          $data["success"] = false;
          $response = $this-&gt;view($data, 200);
          return $this-&gt;handleView($response);  
      }
  
      //Buscamos el usuario
  
      $user = $em-&gt;getRepository('AppBundle:User')-&gt;findOneBy(array('id' =&gt; $iduser));
      /*$qb = $em-&gt;createQueryBuilder();
      $user = $qb-&gt;select('u')
                   -&gt;from('AppBundle:User', 'u')
                  -&gt;where("u.id = '$iduser'")
                   -&gt;getQuery()
                   -&gt;getResult();*/
  
      if(!$user)
      {
          $data["success"] = false;
          $response = $this-&gt;view($data, 200);
          return $this-&gt;handleView($response);            
      }
  
  
      $command = new Command();
      $command-&gt;setStartdate($startdate);
      $command-&gt;setStatecommand($statecommand); 
      $command-&gt;setBuy($command-&gt;getBuy()+1); 
      $command-&gt;setExpense($expense);
      $command-&gt;setUser($user);                  
      $command-&gt;setTable($table);      
  
  
      //Metemos el nuevo command en la base de datos
      $em-&gt;persist($command);
      $flush = $em-&gt;flush();  
      $data = ["success"=&gt;true];
      $data["user"] = $user;
      $response = $this-&gt;view($data, 200);
      return $this-&gt;handleView($response); 
  }
  </code></pre>
  
  <p>In other activities i have used the same procedure with the same Entity and it runs without problems.</p>
  
  <p>Help me please!! It's drive me crazy!
  Thanks!!</p>