title: Does the Yii CActiveRecord class have a first() method?
body: <p>I need to just get the first record from a Yii CActiveRecord derived class. In Rails I would just be able to do this:</p>
  
  <pre><code>post = Post.first
  </code></pre>
  
  <p>I thought I could do the same thing with Yii like this:</p>
  
  <pre><code>$post = Post::model()-&gt;first();
  </code></pre>
  
  <p>But that method doesn't exist. Do I have to just do find with a condition to get the first record? </p>
  
  <p>I don't see first() in the docs for CActiveRecord so I assume the answer is no, it doesn't have a first method. So how would one go about querying just the first record?</p>
  
  <p>This works but sure is an ugly hack. Surely there's a better way.</p>
  
  <pre><code>$first = Post::model()-&gt;findAll(array('order'=&gt;id, 'limit'=&gt;1));
  </code></pre>