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/>'; } } }
public function searchJobsIndex() { $query = JobIndex::find(); $query->where(['title' => $this->title]); return $query->all(); }