| @@ 407-411 (lines=5) @@ | ||
| 404 | */ |
|
| 405 | public static function checkProfileModel($model) |
|
| 406 | { |
|
| 407 | if (!($model instanceof ActiveRecordInterface)){ |
|
| 408 | $modelClass = (new\ReflectionClass($model)); |
|
| 409 | throw new InvalidConfigException($modelClass->getNamespaceName() . |
|
| 410 | '\\' . $modelClass->getShortName().' class must be implemented from yii\db\ActiveRecordInterface.'); |
|
| 411 | } |
|
| 412 | ||
| 413 | if (!($model instanceof IdentityInterface)){ |
|
| 414 | $modelClass = (new\ReflectionClass($model)); |
|
| @@ 413-417 (lines=5) @@ | ||
| 410 | '\\' . $modelClass->getShortName().' class must be implemented from yii\db\ActiveRecordInterface.'); |
|
| 411 | } |
|
| 412 | ||
| 413 | if (!($model instanceof IdentityInterface)){ |
|
| 414 | $modelClass = (new\ReflectionClass($model)); |
|
| 415 | throw new InvalidConfigException($modelClass->getNamespaceName() . |
|
| 416 | '\\' . $modelClass->getShortName().' class must be implemented from yii\web\IdentityInterface.'); |
|
| 417 | } |
|
| 418 | } |
|
| 419 | ||
| 420 | /** |
|
| @@ 416-419 (lines=4) @@ | ||
| 413 | ||
| 414 | $modelObject = $this->getNewModel(); |
|
| 415 | ||
| 416 | if (!method_exists($modelObject, 'findOne')){ |
|
| 417 | $class = (new\ReflectionClass($modelObject)); |
|
| 418 | throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\' . $class->getShortName().' class.'); |
|
| 419 | } |
|
| 420 | ||
| 421 | $result = call_user_func([ |
|
| 422 | $modelObject, |
|