db */ public $db = null; /** * Key, used to encrypt and decrypt comment service data. * * @var string Encryption key */ public static $encryptionKey = 'artbox-comment'; /** * Whether to enable comment rating or not. * * @var bool */ public $enableRating = true; /** * Whether to enable comment premoderate or not. * * @var bool */ public $enablePremoderate = true; /** * Initializes the module. * This method is called after the module is created and initialized with property values * given in configuration. The default implementation will initialize * [[controllerNamespace]] if it is not set. If you override this method, please make sure * you call the parent implementation. */ public function init() { if ($this->commentModelClass === null) { $this->commentModelClass = CommentModel::className(); } if ($this->enableRating && $this->ratingModelClass === null) { $this->ratingModelClass = RatingModel::className(); } if (\Yii::$app instanceof Application) { $this->controllerNamespace = 'artbox\webcomment\commands'; } elseif ($this->userIdentityClass === null) { $this->userIdentityClass = Yii::$app->getUser()->identityClass; } if ($this->db === null) { $this->db = \Yii::$app->db; } if (!Yii::getAlias('@artbox/webcomment', false)) { Yii::setAlias('@artbox/webcomment', __DIR__); } parent::init(); } /** * Prompt to register current module * * @throws \yii\base\InvalidConfigException */ public static function registerMe() { throw new InvalidConfigException(\Yii::t('artbox-comment', 'Register artbox-comment module')); } }