Skip to content

Commit a85e1f2

Browse files
committed
Use ActiveRecordInterface to detect AR model for correct work with mongodb AR model
1 parent 9276447 commit a85e1f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/MultipleInputColumn.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use yii\base\InvalidConfigException;
1212
use yii\base\Model;
13-
use yii\db\ActiveRecord;
13+
use yii\db\ActiveRecordInterface;
1414
use yii\helpers\Html;
1515
use unclead\widgets\components\BaseColumn;
1616

@@ -76,9 +76,10 @@ private function getInputNamePrefix()
7676
private function hasModelAttribute($name)
7777
{
7878
$model = $this->widget->model;
79+
7980
if ($model->hasProperty($name)) {
8081
return true;
81-
} elseif ($model instanceof ActiveRecord && $model->hasAttribute($name)) {
82+
} elseif ($model instanceof ActiveRecordInterface && $model->hasAttribute($name)) {
8283
return true;
8384
} else {
8485
return false;

0 commit comments

Comments
 (0)