You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class BackgroundJob extends Job
{
public function handle()
{
$data = $this->data;
file_put_contents('logs.txt', json_encode($data).PHP_EOL, FILE_APPEND);
$res = (new WC_Product_CSV_Importer($data['file'], $data['data']))->import();
file_put_contents('logs_result.txt', json_encode($res).PHP_EOL, FILE_APPEND);
}
}
================other class=======================
the other class is Axnt_Import_Controller and get Data from it, but BackgroundJob class is not work ,can not get $this->data. needs more config data let it works ?? Wordpress I don't understand。 Thank you very much!!
$import = new Axnt_Import_Controller();
$import->file = $upload['file'];
wpj()->addJob(BackgroundJob::class, $import->import())->dispatch();
The text was updated successfully, but these errors were encountered:
use WpQueuedJobs\Jobs\Job;
class BackgroundJob extends Job
{
public function handle()
{
$data = $this->data;
file_put_contents('logs.txt', json_encode($data).PHP_EOL, FILE_APPEND);
$res = (new WC_Product_CSV_Importer($data['file'], $data['data']))->import();
file_put_contents('logs_result.txt', json_encode($res).PHP_EOL, FILE_APPEND);
}
}
================other class=======================
the other class is Axnt_Import_Controller and get Data from it, but BackgroundJob class is not work ,can not get $this->data. needs more config data let it works ?? Wordpress I don't understand。 Thank you very much!!
$import = new Axnt_Import_Controller();
$import->file = $upload['file'];
wpj()->addJob(BackgroundJob::class, $import->import())->dispatch();
The text was updated successfully, but these errors were encountered: