예제 #1
0
 /**
  * @param string $id 
  * @return Form\Select
  */
 public function getInteresantById($id)
 {
     $interesant = new Interesant();
     $client = new \GuzzleHttp\Client();
     $res = $client->get("http://interesant.dev/info/{$id}", ['headers' => ['Accept' => 'application/json']]);
     if ($res->getStatusCode() == 200) {
         $json = $res->getBody()->getContents();
         $serializer = new \Itav\Component\Serializer\Serializer();
         $serializer->unserialize($json, Interesant::class, $interesant);
     }
     return $interesant;
 }
예제 #2
0
 /**
  * @param string $id 
  * @return Tax
  */
 public function getTaxById($id)
 {
     $tax = new Tax();
     $client = new \GuzzleHttp\Client();
     $res = $client->get("http://product.dev/tax/info/{$id}", ['headers' => ['Accept' => 'application/json']]);
     if ($res->getStatusCode() == 200) {
         $json = $res->getBody()->getContents();
         $serializer = new \Itav\Component\Serializer\Serializer();
         $serializer->unserialize($json, Tax::class, $tax);
     }
     return $tax;
 }