Created
April 8, 2019 10:44
-
-
Save rajwa766/1230fa32457caa6d45c90f908eae58a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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