This commit is contained in:
lopar
2020-07-06 22:54:50 +03:00
parent 69b3fa5ab3
commit 083f4fe438
3 changed files with 103 additions and 38 deletions
+30
View File
@@ -0,0 +1,30 @@
<?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);
} catch (\Krugozor\Database\Mysql\Exception $exception) {
echo '<div class="debug">' . $exception . '</div>';
}
}
public function getDressedItems()
{
while ($row = $this->DB->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
$this->dressedItem[$row['dressed_slot']] = $row;
}
return $this->dressedItem;
}
}