title: ZendFramework 2 - how to call zfcUser from the Model class
body: <p>I am trying to call <strong>ZFCUser</strong> from a class within my model but i keep getting this message:</p>
  
  <pre><code>Call to undefined method Members\Model\MemberTable::zfcUserAuthentication()
  </code></pre>
  
  <p><strong>this is how i tried to call it:</strong> </p>
  
  <pre><code>public function getUserEntity()
      {
          if($this-&gt;zfcUserAuthentication()-&gt;getAuthService()-&gt;hasIdentity())
          {
              if (!$this-&gt;user_entity) 
              {
                  $this-&gt;setUserEntity($this-&gt;zfcUserAuthentication()-&gt;getAuthService()-&gt;getIdentity());
              }
              return $this-&gt;user_entity;
          }
      } 
  </code></pre>
  
  <p>i suspect that i need to implement/extend a class inorder for ZFcuser to be recoginised. </p>
  
  <p>i would really appriciate some quick advice on this. </p>
  
  <p>thank you  </p>
  
  <p><strong>by the way</strong></p>
  
  <p>the ZFCUser works when i call it from my controller so, the use Zend\Mvc\Controller\AbstractActionController obviouly enables this to be recoginised. </p>
  
  <p>but what is the equivalent of the AbstractActionController for other classes in your framework. </p>