2020-07-04 13:49:43 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Author: lopiu
|
|
|
|
* Date: 04.07.2020
|
|
|
|
* Time: 13:17
|
|
|
|
*/
|
2020-10-28 22:21:08 +02:00
|
|
|
namespace Battles\Models;
|
2021-01-28 23:05:34 +02:00
|
|
|
|
2022-01-27 01:15:33 +02:00
|
|
|
use Battles\Database\Db;
|
2020-07-04 13:49:43 +03:00
|
|
|
|
|
|
|
class PresentsModel
|
|
|
|
{
|
2020-07-06 00:16:22 +03:00
|
|
|
protected $DB;
|
|
|
|
|
|
|
|
public function __construct(int $user_id)
|
|
|
|
{
|
2020-07-22 12:27:05 +03:00
|
|
|
if (!$this->DB) {
|
2022-01-27 01:15:33 +02:00
|
|
|
$this->DB = Db::getInstance()->execute('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?', $user_id);
|
2020-07-22 12:27:05 +03:00
|
|
|
}
|
2020-07-06 00:16:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getAllPresents()
|
|
|
|
{
|
|
|
|
return $this->DB;
|
|
|
|
}
|
2020-07-04 13:49:43 +03:00
|
|
|
}
|