battles/classes/DressedItems.php

30 lines
687 B
PHP
Raw Normal View History

2020-07-06 19:54:50 +00:00
<?php
/**
* Author: lopiu
* Date: 06.07.2020
* Time: 22:41
*/
class DressedItems
{
protected $DB;
private $dressedItem;
public function __construct(int $user_id)
{
try {
$this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $user_id);
2020-07-06 20:10:24 +00:00
} catch (Exception $e) {
echo '<div class="debug">' . $e . '</div>';
2020-07-06 19:54:50 +00:00
}
}
public function getDressedItems()
{
while ($row = $this->DB->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
$this->dressedItem[$row['dressed_slot']] = $row;
}
return $this->dressedItem;
}
}