|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function getCurrentProducer() |
|
|
public static function getCurrentProducer() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if(\Yii::$app->controller->module->id == 'app-console') { |
|
|
|
|
|
return \Yii::$app->logic->getProducerContext(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$producerModule = ProducerModule::getInstance(); |
|
|
$producerModule = ProducerModule::getInstance(); |
|
|
if(!\Yii::$app->parameterBag->has('producer') || !\Yii::$app->parameterBag->get('producer')) { |
|
|
if(!\Yii::$app->parameterBag->has('producer') || !\Yii::$app->parameterBag->get('producer')) { |
|
|
\Yii::$app->parameterBag->set('producer', $producerModule->findOneProducerById(self::getCurrentProducerId())); |
|
|
\Yii::$app->parameterBag->set('producer', $producerModule->findOneProducerById(self::getCurrentProducerId())); |