title: Yii left join by CDbCriteria
body: <p>Have two tables:</p>
  
  <p><strong>Content</strong></p>
  
  <pre><code> id |  text
  ------------
   1  | text1
   2  | text2
   3  | text3
   4  | text4
  </code></pre>
  
  <p><strong>Photos</strong></p>
  
  <pre><code> id |  content_id |  src
  -----------------------------
   1  |      1      |  img1.png
   2  |      1      |  img2.png
   3  |      2      |  img3.png
   4  |      3      |  img1.png
  </code></pre>
  
  <p>Trying to get content with left joined photos from third controller.</p>
  
  <p>My code:</p>
  
  <pre><code>$oDBC = new CDbCriteria();
  $oDBC-&gt;select = 't.*,p.*'; 
  $oDBC-&gt;join = 'LEFT JOIN photos p ON t.id = p.content_id'; 
  $oDBC-&gt;condition = 't.step_id = "'.$model-&gt;id.'"';
  
  $content = Content::model()-&gt;find($oDBC);
  </code></pre>
  
  <p>In ContentController added function:</p>
  
  <pre><code>public function relations()
  {
      return array('photos' =&gt; array(self::HAS_MANY, 'Photos', 'content_id');
  }
  </code></pre>
  
  <p>But <code>print_r($content)</code> returns only content data, without photos data.</p>
  
  <p>Like in <a href="https://stackoverflow.com/a/4995486/739897">this</a> answer I tried:</p>
  
  <pre><code>print_r($content-&gt;photos);
  </code></pre>
  
  <p>but got <code>Property "Content.photos" is not defined.</code></p>
  
  <p>What am I doing wrong?</p>