Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 10 |
| SurveyImportAnswersForm | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
12.00 | |
0.00% |
0 / 10 |
| rules | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 5 |
|||
| getContent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
| <?php | |
| namespace backend\models; | |
| use Yii; | |
| use yii\base\Model; | |
| /** | |
| * Survey Import Answers form | |
| */ | |
| class SurveyImportAnswersForm extends Model | |
| { | |
| public $answers_file; | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function rules() | |
| { | |
| return [ | |
| ['answers_file', 'file', 'skipOnEmpty' => false, 'extensions' => 'csv'], | |
| ]; | |
| } | |
| /** | |
| * Signs user up. | |
| * | |
| * @return User|null the saved model or null if saving fails | |
| */ | |
| public function getContent() | |
| { | |
| if ($this->answers_file != null) | |
| return file_get_contents($this->answers_file->tempName); | |
| return null; | |
| } | |
| } |