You are right. But still it requires an instance, while is_subclass_of()
doesn't.


On Thu, Apr 17, 2014 at 9:57 AM, Alexander Makarov <notifications@github.com
> wrote:

> In extensions/gii/generators/crud/Generator.php:
>
> > @@ -433,11 +433,19 @@ public function generateUrlParams()
> >          $class = $this->modelClass;
> >          $pks = $class::primaryKey();
> >          if (count($pks) === 1) {
> > -            return "'id' => \$model->{$pks[0]}";
> > +            if (get_parent_class(new $class) == 'yii\mongodb\ActiveRecord') {
>
> Why? You can do $class instanceof non\existing\ClassName safely. It
> doesn't trigger autoload or anything.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/yiisoft/yii2/pull/3134/files#r11732991>
> .
>