/** * We just check whether module is installed and user is logged in. * @return bool */ public static function hasUser() { if (!Yii::$app instanceof Application) { return false; } if (!Yii::$app->db->getTableSchema(User::tableName())) { return false; } try { $identityClass = Yii::$app->user->identityClass; } catch (\Exception $e) { $identityClass = false; } if (!$identityClass) { return false; } return !Yii::$app->user->isGuest; }
public function down() { $this->dropTable(User::tableName()); }