/** * @param Tests $test * @return array */ public function transform(Tests $test) { $result = []; foreach ($test->column() as $key => $value) { if (isset($this->config['fields']) && !in_array($value, $this->config['fields'])) { continue; } $result[$value] = $test->{$key}; } return $result; }
/** * @return \yii\db\ActiveQuery */ public function getTest() { return $this->hasOne(Tests::className(), ['Test_ID' => 'Test_ID']); }