Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #81 from shadlaws/3.3/develop
Change _initialize() to set the object name only if none predefined.  Fixes #4733
  • Loading branch information
zeelot committed May 2, 2013
2 parents 7a19687 + aebe3ab commit 9273028
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/Kohana/ORM.php
Expand Up @@ -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))
Expand Down

0 comments on commit 9273028

Please sign in to comment.