battles/classes/Battles/Models/PresentsModel.php

26 lines
461 B
PHP

<?php
/**
* Author: lopiu
* Date: 04.07.2020
* Time: 13:17
*/
namespace Battles\Models;
use Battles\Database\DBPDO;
class PresentsModel
{
protected $DB;
public function __construct(int $user_id)
{
if (!$this->DB) {
$this->DB = DBPDO::INIT()->execute('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?', $user_id);
}
}
public function getAllPresents()
{
return $this->DB;
}
}