init
This commit is contained in:
		
							parent
							
								
									db73582407
								
							
						
					
					
						commit
						6b91f8e8bd
					
				|  | @ -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(); | ||||
| } | ||||
		Loading…
	
		Reference in New Issue