This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/includes/kohana/system/classes/Kohana/Model.php

30 lines
609 B
PHP
Raw Normal View History

2012-11-09 12:18:50 +00:00
<?php defined('SYSPATH') OR die('No direct script access.');
2010-08-21 04:43:03 +00:00
/**
* Model base class. All models should extend this class.
*
* @package Kohana
* @category Models
* @author Kohana Team
2012-11-09 12:18:50 +00:00
* @copyright (c) 2008-2012 Kohana Team
2011-05-13 06:00:25 +00:00
* @license http://kohanaframework.org/license
2010-08-21 04:43:03 +00:00
*/
abstract class Kohana_Model {
/**
2011-05-13 06:00:25 +00:00
* Create a new model instance.
2010-08-21 04:43:03 +00:00
*
* $model = Model::factory($name);
*
2012-11-09 12:18:50 +00:00
* @param string $name model name
2010-08-21 04:43:03 +00:00
* @return Model
*/
2011-05-13 06:00:25 +00:00
public static function factory($name)
2010-08-21 04:43:03 +00:00
{
// Add the model prefix
$class = 'Model_'.$name;
2011-05-13 06:00:25 +00:00
return new $class;
2010-08-21 04:43:03 +00:00
}
} // End Model