Основные классы переехали на обёртку PDO. Плановое №16.
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
* Time: 13:17
|
||||
*/
|
||||
namespace Battles\Models;
|
||||
use Exceptions\GameException;
|
||||
|
||||
use Battles\Database\DBPDO;
|
||||
|
||||
class PresentsModel
|
||||
{
|
||||
@@ -14,7 +15,7 @@ class PresentsModel
|
||||
public function __construct(int $user_id)
|
||||
{
|
||||
if (!$this->DB) {
|
||||
$this->DB = \db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
||||
$this->DB = DBPDO::INIT()->execute('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?', $user_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +23,4 @@ class PresentsModel
|
||||
{
|
||||
return $this->DB;
|
||||
}
|
||||
|
||||
public function getPresentsSum()
|
||||
{
|
||||
return $this->DB->getNumRows();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user