diff --git a/src/Fufle/ORM/Model.php b/src/Fufle/ORM/Model.php index 74ff5f7..96a9640 100644 --- a/src/Fufle/ORM/Model.php +++ b/src/Fufle/ORM/Model.php @@ -24,7 +24,7 @@ abstract class Model { } protected static function Query($sql, $params) { - self::Initialize(); + self::Check(); return ConnectionManager::Query( $sql, $params, @@ -32,17 +32,19 @@ abstract class Model { } protected static function QueryAll($sql, $params) { - self::Initialize(); + self::Check(); return ConnectionManager::QueryAll( $sql, $params, get_called_class()); } - - abstract public static function Initialize() { + + public static function Check() { if (static::$table === null) { static::$table = basename(get_called_class()) . 's'; } static::Initialize(); } + + abstract public static function Initialize(); } \ No newline at end of file