2022-08-09 19:57:43 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Author: lopiu
|
|
|
|
* Date: 04.07.2020
|
|
|
|
* Time: 13:17
|
|
|
|
*/
|
2022-12-16 23:20:43 +00:00
|
|
|
|
2022-08-09 19:57: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-08-09 19:57:43 +00:00
|
|
|
{
|
2022-12-16 23:20:43 +00:00
|
|
|
if (is_null($userId)) {
|
|
|
|
$userId = User::getInstance()->getId();
|
2022-08-09 19:57:43 +00:00
|
|
|
}
|
2022-12-16 23:20:43 +00:00
|
|
|
return Db::getInstance()->execute('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?', $userId);
|
2022-08-09 19:57:43 +00:00
|
|
|
}
|
2022-12-16 23:20:43 +00:00
|
|
|
}
|