Skip to content
Snippets Groups Projects
Commit 7112e326 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

bugfix

parent 6ca66fce
No related branches found
No related tags found
No related merge requests found
...@@ -4,16 +4,23 @@ public static function getAllProducts(){ ...@@ -4,16 +4,23 @@ public static function getAllProducts(){
$itemConfig = Connexion::pdo()->query("SELECT itemConfig FROM qs_shops")->fetchColumn(); $itemConfig = Connexion::pdo()->query("SELECT itemConfig FROM qs_shops")->fetchColumn();
$items = yaml_parse($itemConfig); $items = yaml_parse($itemConfig);
/*
item:
==: org.bukkit.inventory.ItemStack
v: 2865
type: WHEAT
*/
$return = array(); $return = array();
foreach($items as $item){ foreach($items as $item){
$itemAleadyEntered = false; $itemAleadyEntered = false;
foreach($return as $checkItem){ foreach($return as $checkItem){
if($item == $checkItem->getId()){ if($item->item->type == $checkItem->getId()){
$itemAleadyEntered = true; $itemAleadyEntered = true;
} }
} }
if(!$itemAleadyEntered){ if(!$itemAleadyEntered){
$return[] = new Item($item); $return[] = new Item($item->item->type);
} }
} }
return $return; return $return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment