title: yii2 listdata convert from yii1.x
body: <p>How can i convert the following to yii2</p>
  
  <pre><code>$dependency = new CDbCacheDependency('SELECT count(*) FROM job_title');
  $jobTitle  = JobTitle ::model()-&gt;cache(CACHE_TIMEOUT,$dependency)-&gt;findAll($array);
  $jobTitleList = CHtml::listData($jobTitle, 'job_title_id','desc');
  return $jobTitleList;
  </code></pre>
  
  <p>I have the following code which does not work.</p>
  
  <pre><code>use yii\db\ActiveRecord;
  use yii\helpers\ArrayHelper;
  use yii\helpers\Html;
  
  $items = array();
  foreach (Jobsprocess::find()-&gt;where($array)-&gt;all() as $value) {
      $items[$value-&gt;process_id] = $value-&gt;jobsprocess;
  }
  return $items;
  </code></pre>