Ejemplo n.º 1
0
 public function getChartImage(Chart $chart, $filename = null)
 {
     $url = $this->buildQuery(sprintf('/json/pregnancy/%s/chartimage', $chart->getGrowchartid()));
     $res = $this->doRequest($url, $chart->toJson());
     $imageurl = (string) $res->url;
     if ($filename) {
         $content = $this->httpRequest($imageurl);
         file_put_contents($filename . '.' . $chart->getFormat(), $content);
     }
     return $imageurl;
 }