title: ATK4: Error: Using $this when not in object context
body: <p>I am defining a method in ATK4 with an expression field in it:</p>
  
  <pre><code>$this-&gt;addExpression('answered')-&gt;set(function($model,$select){
      return $select-&gt;dsql()
            -&gt;table('answer')
            -&gt;field($select-&gt;expr('if(count(*)&gt;0,"Y","") as answered'))
            -&gt;where('usecollection_id',$select-&gt;getField('id'))
            -&gt;where('student_id',$this-&gt;api-&gt;auth-&gt;get('id'));
  
    })-&gt;type('boolean')-&gt;caption('Besvaret');
  </code></pre>
  
  <p>It works fine on my development machine, but on the production server it throws a fatal error: PHP Fatal error: Using $this when not in object context in file.php</p>
  
  <p>This is the problematic line: </p>
  
  <pre><code>$this-&gt;api-&gt;auth-&gt;get('id')
  </code></pre>
  
  <p>Any idea what causes this difference and how to make it work?</p>