/** @return \cubiclab\store\StoreCube|null Module instance */ public function getModule() { if ($this->_module === null) { $module = StoreCube::getInstance(); if ($module instanceof StoreCube) { $this->_module = $module; } else { $this->_module = Yii::$app->getModule('store'); } } return $this->_module; }