示例#1
0
 /**
  * @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;
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTest()
 {
     return $this->hasOne(Tests::className(), ['Test_ID' => 'Test_ID']);
 }