tests
This commit is contained in:
parent
d68f9b232a
commit
642fb82938
@ -64,6 +64,11 @@ class Item
|
||||
public $mfuvorot;
|
||||
public $mfauvorot;
|
||||
|
||||
/**
|
||||
* Item constructor.
|
||||
*
|
||||
* @param $row
|
||||
*/
|
||||
public function __construct($row)
|
||||
{
|
||||
$this->name = $row['name'];
|
||||
|
@ -8,6 +8,9 @@
|
||||
|
||||
class ItemClass extends Item
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function printItemStats()
|
||||
{
|
||||
echo $this->name ." (Масса: ". $this->massa .")<br>";
|
||||
|
2
test.php
2
test.php
@ -17,7 +17,7 @@ require_once 'config.php';
|
||||
$result = db::c()->query('SELECT * FROM `shop` WHERE count > 0');
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$iteminfo[] = new Item($row);
|
||||
$iteminfo[] = new ItemClass($row);
|
||||
}
|
||||
|
||||
foreach ($iteminfo as $iinfo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user