| @@ 50-63 (lines=14) @@ | ||
| 47 | /** |
|
| 48 | * {@inheritdoc} |
|
| 49 | */ |
|
| 50 | public function callApiWoeid($woeid = null, $unit = 'c') |
|
| 51 | { |
|
| 52 | if ($woeid === null && $this->woeid === null) { |
|
| 53 | throw new \Exception('Please provide a woeid code', 400); |
|
| 54 | } |
|
| 55 | ||
| 56 | if ($woeid !== null) { |
|
| 57 | $this->woeid = $woeid; |
|
| 58 | } |
|
| 59 | ||
| 60 | $this->yql = Query::URL_BASE.urlencode(sprintf(Query::WOEID_QUERY, $this->woeid, $unit)); |
|
| 61 | ||
| 62 | return $this->callApi(); |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * {@inheritdoc} |
|
| @@ 68-81 (lines=14) @@ | ||
| 65 | /** |
|
| 66 | * {@inheritdoc} |
|
| 67 | */ |
|
| 68 | public function callApiCityName($city = null, $unit = 'c') |
|
| 69 | { |
|
| 70 | if ($city === null && $this->city === null) { |
|
| 71 | throw new \Exception('Please provide a city\'s name', 400); |
|
| 72 | } |
|
| 73 | ||
| 74 | if ($city !== null) { |
|
| 75 | $this->city = $city; |
|
| 76 | } |
|
| 77 | ||
| 78 | $this->yql = Query::URL_BASE.urlencode(sprintf(Query::CITY_NAME_QUERY, $this->city, $unit)); |
|
| 79 | ||
| 80 | return $this->callApi(); |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * {@inheritdoc} |
|