getCurrentProducer(); } else { return \Yii::$app->params[$key]; } } public static function getOpendistribVersion() { return self::get('version'); } public static function getCurrentProducer() { if (\Yii::$app->params['producer'] == false) { \Yii::$app->params['producer'] = Producer::searchOne(); } return \Yii::$app->params['producer']; } /** * Retourne l'ID du producteur courant. * * @return integer|boolean */ public static function getCurrentProducerId() { if (\Yii::$app->controller->module->id == 'app-backend') { if (!\Yii::$app->user->isGuest) { return Yii::$app->user->identity->id_producer; } } else { return \Yii::$app->controller->getProducer()->id; } return false; } }