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