<?php

namespace frontend\jobs;

use Yii;
use yii\base\BaseObject;
use frontend\models\Products;
use yii\helpers\Json;

class SaveProducts extends BaseObject implements \common\components\Queue\JobInterface
{
    public $filepath;
    public $model;
        /**
     * Runs Imports from Various Sources.
     *
     * @param [type] $queue
     * @return void
     */
    public function execute($queue)
    {
        foreach(Products::find()->each() as $model){
            $model->save();
        }       
    }
}
