public static function canSelect(BaseActiveRecord $model, $params = []) { if ($model instanceof MozaykaActiveRecord) { return $model->canSelect($params); } else { return method_exists($model, 'canSelect') && is_callable([$model, 'canSelect']) ? $model->canSelect($params) : (bool) $model::primaryKey(); } }