title: Circular Reference when injecting Security Context into (Entity Listener) Class
body: <p>There was 2 questions here saying injecting the whole service container should solve this. But question ... see below (note difference between try 2 &amp; 3) ... </p>
  
  <p><strong>Try 1</strong></p>
  
  <pre><code>public function __construct(SecurityContext $securityContext) {
      $this-&gt;securityContext = $securityContext);  
  }  
  </code></pre>
  
  <p>Curcular Reference. <em>Okay ...</em></p>
  
  <p><strong>Try 2</strong></p>
  
  <pre><code>public function __construct(ContainerInterface $container) {
      $this-&gt;securityContext = $container-&gt;get('security.context');  
  }  
  </code></pre>
  
  <p>Circular Reference (<strong>Why?</strong>, I am injecting the container like in try 3 except I got the security context only)</p>
  
  <p><strong>Try 3</strong></p>
  
  <pre><code>public function __construct(ContainerInterface $container) {
      $this-&gt;container = $container;  
  }  
  </code></pre>
  
  <p>Works.</p>