add answer, time, status helpers

This commit is contained in:
iIronside
2021-10-29 17:06:09 +03:00
parent 34c2998844
commit 7b8847e1e1
42 changed files with 2505 additions and 570 deletions

View File

@ -2,7 +2,6 @@
namespace common\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
use yii\helpers\ArrayHelper;
@ -79,22 +78,6 @@ class QuestionnaireCategory extends \yii\db\ActiveRecord
return $this->hasMany(Questionnaire::className(), ['category_id' => 'id']);
}
public function getStatuses()
{
return [
self::STATUS_PASSIVE => 'Не используется',
self::STATUS_ACTIVE => 'Активна'
];
}
/**
* @return string status text label
*/
public function getStatusText()
{
return $this->statuses[$this->status];
}
public function getIdTitlesArr()
{
$categories = self::find()->select(['id', 'title'])->where(['status' => '1'])->all();