title: Symfony2, Service with variable as argument
body: <p>Is it possible to pass a variable as an argument to a service?</p>
  
  <p>I have a service that does some stuff with the entity-manager.<br><br>
  Something like:  </p>
  
  <pre><code>$this -&gt; container -&gt; get('getuser')-&gt;setArgument2($someVariable);
  </code></pre>
  
  <p>Is that SOMEHOW possible?</p>
  
  <p>config.yml</p>
  
  <pre><code>services:
  getuser:
      class: fancypathtoservice
      arguments: [@doctrine.orm.entity_manager]
  </code></pre>
  
  <p>My service:</p>
  
  <pre><code>class GetUser
  {
  public function getuserAction($userid)
  {
  
      $em = $this-&gt;em;
  
      $query = $em-&gt;createQuery(
          'SELECT p
  FROM SomeBundle:User p
  WHERE p.userid = :id'
      )-&gt;setParameters(array(
              'id' =&gt; $userid,
          ));
  
      $user = $query-&gt;getResult();
      $user = $user[0];
  
      return $user;
  }
  
  protected $em;
  
  public function __construct(EntityManager $entityManager)
  {
      $this-&gt;em = $entityManager;
  }
  }
  </code></pre>
  
  <p>And in the controller i call</p>
  
  <pre><code>$player = $this -&gt; container -&gt; get('getuser');
  </code></pre>
  
  <p>Now i need the controller to pass the $userid to the service. Is that possible somehow?</p>
  
  <p>Regards</p>