title: Yii - are most of functions in model files supposed to be static function?
body: <p>I'm a Yii framework user.</p>
  
  <p>mostly I define functions as public static function in my model files like the example function below.</p>
  
  <pre><code>public static function getTrashedPostCount(){           
      $connection=Yii::app()-&gt;db;     
      $sql = "SELECT COUNT(publish_status)
                  FROM {{post}}
                  WHERE publish_status = 'trash'";              
      $command=$connection-&gt;createCommand($sql);
      $postCount = $command-&gt;queryScalar();
      return $postCount;      
  }   
  </code></pre>
  
  <p>I wonder if I'm doing wrong.</p>
  
  <p>are most of functions in model files supposed to be static function?</p>
  
  <p>Please let me know if I'm doing or understanding wrong.</p>
  
  <p>Thanks!!!</p>