public static function getModel($type) { if (self::$model) { return self::$model; } if ($type == 'pdopostgres') { include dirname(__FILE__) . DS . 'install_postgres.php'; self::$model = new SomeModelInstall_Postgres(); } else { if ($type == 'pdomysql') { include dirname(__FILE__) . DS . 'install_mysql.php'; self::$model = new SomeModelInstall_Mysql(); } } self::$model->loadConfiguration(); return self::$model; }