Esempio n. 1
0
 public function actionIndexer()
 {
     $jobs = Job::find()->all();
     foreach ($jobs as $job) {
         $jobIndex = new JobIndex();
         $jobIndex->attributes = $job->attributes;
         if (!$jobIndex->save()) {
             die(var_dump($jobIndex->getErrors()));
         } else {
             echo 'Saved :)';
             echo '<br/>';
         }
     }
 }
Esempio n. 2
0
 public function searchJobsIndex()
 {
     $query = JobIndex::find();
     $query->where(['title' => $this->title]);
     return $query->all();
 }