diff --git a/classes/Kohana/ORM.php b/classes/Kohana/ORM.php index 81298d2..4b6978b 100644 --- a/classes/Kohana/ORM.php +++ b/classes/Kohana/ORM.php @@ -288,8 +288,11 @@ public function __construct($id = NULL) */ protected function _initialize() { - // Set the object name and plural name - $this->_object_name = strtolower(substr(get_class($this), 6)); + // Set the object name if none predefined + if (empty($this->_object_name)) + { + $this->_object_name = strtolower(substr(get_class($this), 6)); + } // Check if this model has already been initialized if ( ! $init = Arr::get(ORM::$_init_cache, $this->_object_name, FALSE))