protected function init(JobIdentity $identity) { $ordersCount = \_Product::model()->count(); $this->tasksCount = ceil($ordersCount / $this->limit); $this->popularProductIds = \Product::getPopular(); }