title: yii2 ActiveRecord query to get a specific relation object
body: <p>Lets say I have a product. That product can have multiple texts. In my query I only want to get a specific text. I dont want to get all the texts and then make a loop to ckeck. Is that possible? I tried a couple things:</p>
  
  <pre><code>$nameArticle = Product::find([
      'id',
      'pld.product_name as productName'
  ])
      -&gt;from('product p')
      -&gt;joinWith('productLanguageData.language')
      -&gt;where(['p.id' =&gt; $value['product']])
      -&gt;andWhere(['pl.iso_language' =&gt; 'es']) //query, please give me only spanish text.
      -&gt;one();
  </code></pre>
  
  <p>This returns product with all the languages.</p>
  
  <p>How can i make this query work?</p>
  
  <pre><code>public function getLanguage()
  {
      return $this-&gt;hasOne(ProductLanguage::className(), ['id' =&gt; 'language_id'])
          -&gt;from(['pl' =&gt; ProductLanguage::tableName()]);
  }
  </code></pre>