@@ -9,6 +9,10 @@ class Market
99{
1010    public  function  item (int  $ itemId , array  $ servers  = [], string  $ dc  = '' )
1111    {
12+         if  (empty ($ servers ) && empty ($ dc )) {
13+             throw  new  \Exception ('You must provide either a list of servers or a DC name ' );
14+         }
15+ 
1216        $ options  = [];
1317
1418        if  ($ servers ) {
@@ -19,11 +23,34 @@ public function item(int $itemId, array $servers = [], string $dc = '')
1923            $ options ['dc ' ] = $ dc ;
2024        }
2125
26+         return  Guzzle::get ("/market/item/ {$ itemId }" , [
27+             RequestOptions::QUERY  => $ options
28+         ]);
29+     }
30+ 
31+     public  function  items (array  $ itemIds , array  $ servers , string  $ dc  = '' )
32+     {
33+         if  (empty ($ itemIds )) {
34+             throw  new  \Exception ('You must provide a list of item ids ' );
35+         }
36+ 
2237        if  (empty ($ servers ) && empty ($ dc )) {
2338            throw  new  \Exception ('You must provide either a list of servers or a DC name ' );
2439        }
2540
26-         return  Guzzle::get ("/market/item/ {$ itemId }" , [
41+         $ options  = [];
42+ 
43+         $ options ['ids ' ] = implode (', ' , $ itemIds );
44+ 
45+         if  ($ servers ) {
46+             $ options ['servers ' ] = implode (', ' , $ servers );
47+         }
48+ 
49+         if  ($ dc ) {
50+             $ options ['dc ' ] = $ dc ;
51+         }
52+ 
53+         return  Guzzle::get ("/market/items " , [
2754            RequestOptions::QUERY  => $ options
2855        ]);
2956    }
@@ -35,6 +62,11 @@ public function search($elasticQuery)
3562        ]);
3663    }
3764
65+     public  function  ids ()
66+     {
67+         return  Guzzle::get ("/market/ids " );
68+     }
69+ 
3870    public  function  categories ()
3971    {
4072        return  Guzzle::get ("/market/categories " );
0 commit comments