/** * [[@doctodo method_description:prepareTask]]. */ public function prepareTask() { $total = 0; if (in_array($this->settings['direction'], ['to_local', 'both'])) { $total += count($this->foreignDataItems); } if (in_array($this->settings['direction'], ['to_foreign', 'both'])) { $total += count($this->localDataItems); } $this->task->setWeight($total * $this->taskWeight); $this->task->setProgressTotal($total); }