Created
August 15, 2012 17:07
-
-
Save taai/3361654 to your computer and use it in GitHub Desktop.
self::get_called_class() throws error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class Base_DB_ORM_Model extends Kohana_Object { | |
public function get_errors_filename() | |
{ | |
$self = get_class($this); | |
return call_user_func(array($self, 'errors_filename')); | |
} | |
public static function errors_filename() { | |
$class_name = self::get_called_class(); | |
// Just get the Model's name and strip the 'Model_Leap_' | |
return substr($class_name, 11); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment