Разбивка inf.php по классам.
This commit is contained in:
@@ -7,7 +7,20 @@
|
||||
|
||||
class PresentsModel
|
||||
{
|
||||
public function getAllPresents($user_id) {
|
||||
return db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
||||
protected $DB;
|
||||
|
||||
public function __construct(int $user_id)
|
||||
{
|
||||
$this->DB = db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
||||
}
|
||||
|
||||
public function getAllPresents()
|
||||
{
|
||||
return $this->DB;
|
||||
}
|
||||
|
||||
public function getPresentsSum()
|
||||
{
|
||||
return $this->DB->getNumRows();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user