Основные классы переехали на обёртку PDO. Плановое №16.

This commit is contained in:
lopar
2021-01-28 23:05:34 +02:00
parent 0099c235a7
commit 8402912098
22 changed files with 284 additions and 1940 deletions

View File

@@ -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();
}
}