Skip to content

Commit cc63820

Browse files
authored
Merge pull request #22 from pana1990/21-related-model
fix #21
2 parents 6810b81 + 54ed37d commit cc63820

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ActiveExcelSheet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function setModelInstance($model)
264264
* @return yii\db\ActiveRecord a new instance of a related model for the
265265
* given model. This is used to obtain column types.
266266
*/
267-
protected function getRelatedModelInstance($model, $name)
267+
protected static function getRelatedModelInstance($model, $name)
268268
{
269269
$class = $model->getRelation($name)->modelClass;
270270
return new $class;
@@ -360,7 +360,7 @@ public static function getType($model, $attribute, $isRelation = false)
360360
$attribute = substr($attribute, $pos + 1);
361361
}
362362
if ($isRelation) {
363-
return $this->getRelatedModelInstance($model, $attribute);
363+
return self::getRelatedModelInstance($model, $attribute);
364364
} else {
365365
return $model->getTableSchema()->columns[$attribute];
366366
}

0 commit comments

Comments
 (0)