Skip to content

Instantly share code, notes, and snippets.

@rajwa766
Created April 8, 2019 10:44
Show Gist options
  • Save rajwa766/1230fa32457caa6d45c90f908eae58a5 to your computer and use it in GitHub Desktop.
Save rajwa766/1230fa32457caa6d45c90f908eae58a5 to your computer and use it in GitHub Desktop.
<?php
namespace common\models\helpers\queue;
use common\models\Product;
use yii\base\BaseObject;
use yii\queue\JobInterface;
/**
* This is the model create job in the queue
*/
class AddToQueue extends BaseObject implements JobInterface
{
/**
* @var int $userId contain user id
* @var array $postData contain the search postdata
*/
public $userId;
public $postData;
/**
* @param Queue $queue which pushed and is handling the job
* @return void|mixed result of the job execution
*/
public function execute($queue)
{
Product::productData($this->postData, $this->userId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment