adding forgotten files

This commit is contained in:
iIronside
2021-10-22 17:02:28 +03:00
parent 2882b8767c
commit e362ad45a4
84 changed files with 21267 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class Answer extends \common\models\Answer
{
}

View File

@ -0,0 +1,73 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\Answer;
/**
* AnswerSearch represents the model behind the search form of `backend\modules\questionnaire\models\Answer`.
*/
class AnswerSearch extends Answer
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'question_id', 'answer_flag', 'status'], 'integer'],
[['answer_body', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Answer::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'question_id' => $this->question_id,
'answer_flag' => $this->answer_flag,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'answer_body', $this->answer_body]);
return $dataProvider;
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace backend\modules\questionnaire\models;
class Question extends \common\models\Question
{
}

View File

@ -0,0 +1,77 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\Question;
/**
* QuestionSearch represents the model behind the search form of `backend\modules\questionnaire\models\Question`.
*/
class QuestionSearch extends Question
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'question_type_id', 'questionnaire_id', 'question_priority', 'next_question', 'status', 'score', 'time_limit'], 'integer'],
[['question_body', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Question::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'question_type_id' => $this->question_type_id,
'questionnaire_id' => $this->questionnaire_id,
'question_priority' => $this->question_priority,
'next_question' => $this->next_question,
'status' => $this->status,
'score' => $this->score,
'time_limit' => $this->time_limit,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'question_body', $this->question_body]);
return $dataProvider;
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class QuestionType extends \common\models\QuestionType
{
}

View File

@ -0,0 +1,69 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\QuestionType;
/**
* QuestionTypeSearch represents the model behind the search form of `backend\modules\questionnaire\models\QuestionType`.
*/
class QuestionTypeSearch extends QuestionType
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id'], 'integer'],
[['question_type', 'slug'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = QuestionType::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
]);
$query->andFilterWhere(['like', 'question_type', $this->question_type])
->andFilterWhere(['like', 'slug', $this->slug]);
return $dataProvider;
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class Questionnaire extends \common\models\Questionnaire
{
}

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class QuestionnaireCategory extends \common\models\QuestionnaireCategory
{
}

View File

@ -0,0 +1,71 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\QuestionnaireCategory;
/**
* QuestionnaireCategorySearch represents the model behind the search form of `backend\modules\questionnaire\models\QuestionnaireCategory`.
*/
class QuestionnaireCategorySearch extends QuestionnaireCategory
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'status'], 'integer'],
[['title', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = QuestionnaireCategory::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'title', $this->title]);
return $dataProvider;
}
}

View File

@ -0,0 +1,73 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\Questionnaire;
/**
* QuestionnaireSearch represents the model behind the search form of `backend\modules\questionnaire\models\Questionnaire`.
*/
class QuestionnaireSearch extends Questionnaire
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'category_id', 'status', 'time_limit'], 'integer'],
[['title', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Questionnaire::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'category_id' => $this->category_id,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'time_limit' => $this->time_limit,
]);
$query->andFilterWhere(['like', 'title', $this->title]);
return $dataProvider;
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class UserQuestionnaire extends \common\models\UserQuestionnaire
{
}

View File

@ -0,0 +1,74 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\UserQuestionnaire;
/**
* UserQuestionnaireSearch represents the model behind the search form of `backend\modules\questionnaire\models\UserQuestionnaire`.
*/
class UserQuestionnaireSearch extends UserQuestionnaire
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'questionnaire_id', 'user_id', 'score', 'status'], 'integer'],
[['uuid', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = UserQuestionnaire::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'questionnaire_id' => $this->questionnaire_id,
'user_id' => $this->user_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'score' => $this->score,
'status' => $this->status,
]);
$query->andFilterWhere(['like', 'uuid', $this->uuid]);
return $dataProvider;
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace backend\modules\questionnaire\models;
class UserResponse extends \common\models\UserResponse
{
}

View File

@ -0,0 +1,75 @@
<?php
namespace backend\modules\questionnaire\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\modules\questionnaire\models\UserResponse;
/**
* UserResponseSearch represents the model behind the search form of `backend\modules\questionnaire\models\UserResponse`.
*/
class UserResponseSearch extends UserResponse
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'user_id', 'question_id', 'user_questionnaire_id'], 'integer'],
[['response_body', 'created_at', 'updated_at'], 'safe'],
[['answer_flag'], 'number'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = UserResponse::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'user_id' => $this->user_id,
'question_id' => $this->question_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'answer_flag' => $this->answer_flag,
'user_questionnaire_id' => $this->user_questionnaire_id,
]);
$query->andFilterWhere(['like', 'response_body', $this->response_body]);
return $dataProvider;
}
}