title: How to solve problem with column name in Active Record Yii2?
body: <p>I have a black list of email domains in db (table <code>black_list_domains</code> with fields <code>id</code> and <code>domain</code>) and I need to validate user's email address while registration.</p>
  
  <p>The validation must add error if user's email matches pattern <code>'%@%domain'</code>.</p>
  
  <p>So, working mysql-query is:</p>
  
  <pre><code>SELECT * FROM `black_list_domains` WHERE '$email' LIKE CONCAT('%@%', domain)"
  </code></pre>
  
  <p>But when I try to make this checking in my Validator's class with Active Record:</p>
  
  <pre><code>BlackListDomains::find()-&gt;where(['like', $email, new \yii\db\Expression("CONCAT('%@%', domain)")])-&gt;exists();
  </code></pre>
  
  <p>it returns a MySQL error <code>Column not found: 1054 Unknown column 'test@test.test' in 'where clause'</code> (<code>test@test.test</code> is user's email address).</p>
  
  <p>I can make a correct query with <code>createCommand</code>:</p>
  
  <pre><code>\Yii::$app-&gt;db-&gt;createCommand("SELECT * FROM `black_list_domains` WHERE '$email' LIKE CONCAT('%@%', domain)")-&gt;queryAll();
  </code></pre>
  
  <p>But I think it is possible to make this with Active Record. Or not?</p>