class app\models\Product{
public static getSomeClass($modelType){
if ($modelType=='MyClass1'){
return 'app\models\MyClass1';
} else{
return 'app\models\MyClass2';
}
}
}
class app\models\MyClass1{
public static function sayHello(){
echo 'Hello';
}
}
$instClass = Product::getSomeClass('MyClass1');
$instClass::sayHello();