public function actionTask($id)
 {
     $model = DiscoveryTask::findOne($id);
     $searchChange = new Change();
     $changeProvider = $searchChange->searchPending(Yii::$app->request->get(), $id);
     return $this->render('task', ['changeProvider' => $changeProvider, 'model' => $model, 'searchChange' => $searchChange]);
 }
Example #2
0
 public function actionApplyAll($task)
 {
     $task = DiscoveryTask::findOne($task);
     try {
         $task->applyChanges();
     } catch (\Exception $e) {
         return false;
     }
     return true;
 }
Example #3
0
 public function getTasks()
 {
     return DiscoveryTask::find()->where(['sync_id' => $this->id])->orderBy(['started_at' => SORT_DESC]);
 }
Example #4
0
 public function getTask()
 {
     return $this->hasOne(DiscoveryTask::className(), ['id' => 'sync_event_id']);
 }