2019-12-21 05:25:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\CatalogRule\Console\Commands;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
use Webkul\CatalogRule\Helpers\CatalogRuleIndex;
|
|
|
|
|
|
|
|
|
|
class PriceRuleIndex extends Command
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The name and signature of the console command.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $signature = 'product:price-rule:index';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The console command description.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $description = 'Automatically updates catalog rule price index information (eg. rule_price)';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new command instance.
|
|
|
|
|
*
|
2020-03-05 05:34:57 +00:00
|
|
|
* @param \Webkul\CatalogRuleProduct\Helpers\CatalogRuleIndex $catalogRuleIndexHelper
|
2019-12-21 05:25:32 +00:00
|
|
|
* @return void
|
|
|
|
|
*/
|
2022-04-01 14:57:11 +00:00
|
|
|
public function __construct(protected CatalogRuleIndex $catalogRuleIndexHelper)
|
2019-12-21 05:25:32 +00:00
|
|
|
{
|
|
|
|
|
parent::__construct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Execute the console command.
|
|
|
|
|
*
|
2020-03-05 05:34:57 +00:00
|
|
|
* @return void
|
2019-12-21 05:25:32 +00:00
|
|
|
*/
|
|
|
|
|
public function handle()
|
|
|
|
|
{
|
2020-02-24 05:53:02 +00:00
|
|
|
$this->catalogRuleIndexHelper->reindexComplete();
|
2019-12-21 05:25:32 +00:00
|
|
|
}
|
|
|
|
|
}
|