Model.php 526 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Model base class. All models should extend this class.
  4. *
  5. * @package Kohana
  6. * @category Models
  7. * @author Kohana Team
  8. * @copyright (c) Kohana Team
  9. * @license https://koseven.ga/LICENSE.md
  10. */
  11. abstract class Kohana_Model {
  12. /**
  13. * Create a new model instance.
  14. *
  15. * $model = Model::factory($name);
  16. *
  17. * @param string $name model name
  18. * @return Model
  19. */
  20. public static function factory($name)
  21. {
  22. // Add the model prefix
  23. $class = 'Model_'.$name;
  24. return new $class;
  25. }
  26. }