battles/classes/Battles/Models/Presents.php

24 lines
427 B
PHP
Raw Permalink Normal View History

<?php
/**
* Author: lopiu
* Date: 04.07.2020
* Time: 13:17
*/
2022-12-16 23:20:43 +00:00
namespace Battles\Models;
use Battles\Database\Db;
use Battles\User;
class Presents
{
2022-12-16 23:20:43 +00:00
public function getAll($userId = null)
{
2022-12-16 23:20:43 +00:00
if (is_null($userId)) {
$userId = User::getInstance()->getId();
}
2022-12-16 23:20:43 +00:00
return Db::getInstance()->execute('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?', $userId);
}
2022-12-16 23:20:43 +00:00
}