|
@@ -44,8 +44,8 @@ |
|
|
block discarded – undo |
|
44
|
44
|
*/ |
|
45
|
45
|
public static function getById($id, PdoDatabase $database) |
|
46
|
46
|
{ |
|
47
|
|
- if( isset( self::$getByIdResults[strtolower(get_called_class())][$id] ) ) return self::$getByIdResults[strtolower(get_called_class())][$id]; |
|
48
|
|
- if( !isset( self::$getByIdStatement[strtolower(get_called_class())] ) ) self::$getByIdStatement[strtolower(get_called_class())] = $database->prepare("SELECT * FROM `" . strtolower(get_called_class()) . "` WHERE id = :id LIMIT 1;"); |
|
|
47
|
+ if (isset(self::$getByIdResults[strtolower(get_called_class())][$id])) return self::$getByIdResults[strtolower(get_called_class())][$id]; |
|
|
48
|
+ if (!isset(self::$getByIdStatement[strtolower(get_called_class())])) self::$getByIdStatement[strtolower(get_called_class())] = $database->prepare("SELECT * FROM `" . strtolower(get_called_class()) . "` WHERE id = :id LIMIT 1;"); |
|
49
|
49
|
self::$getByIdStatement[strtolower(get_called_class())]->bindValue(":id", $id); |
|
50
|
50
|
|
|
51
|
51
|
self::$getByIdStatement[strtolower(get_called_class())]->execute(); |
Please login to merge, or discard this patch.