@@ -1,59 +1,59 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class SendJodel extends AbstractRequest { |
| 4 | - /** |
|
| 5 | - * @var Location |
|
| 6 | - */ |
|
| 7 | - public $location; |
|
| 8 | - /** |
|
| 9 | - * @return Location |
|
| 10 | - */ |
|
| 11 | - public function getLocation() |
|
| 12 | - { |
|
| 13 | - return $this->location; |
|
| 14 | - } |
|
| 15 | - /** |
|
| 16 | - * @param Location $location |
|
| 17 | - */ |
|
| 18 | - public function setLocation($location) |
|
| 19 | - { |
|
| 20 | - $this->location = $location; |
|
| 21 | - } |
|
| 4 | + /** |
|
| 5 | + * @var Location |
|
| 6 | + */ |
|
| 7 | + public $location; |
|
| 8 | + /** |
|
| 9 | + * @return Location |
|
| 10 | + */ |
|
| 11 | + public function getLocation() |
|
| 12 | + { |
|
| 13 | + return $this->location; |
|
| 14 | + } |
|
| 15 | + /** |
|
| 16 | + * @param Location $location |
|
| 17 | + */ |
|
| 18 | + public function setLocation($location) |
|
| 19 | + { |
|
| 20 | + $this->location = $location; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public $ancestor; |
|
| 24 | - /** |
|
| 25 | - * @return Location |
|
| 26 | - */ |
|
| 27 | - public function getAncestor() |
|
| 28 | - { |
|
| 29 | - return $this->ancestor; |
|
| 30 | - } |
|
| 31 | - /** |
|
| 32 | - * @param Location $location |
|
| 33 | - */ |
|
| 34 | - public function setAncestor($ancestor) |
|
| 35 | - { |
|
| 36 | - if(isset($ancestor) && $ancestor != "") |
|
| 37 | - { |
|
| 23 | + public $ancestor; |
|
| 24 | + /** |
|
| 25 | + * @return Location |
|
| 26 | + */ |
|
| 27 | + public function getAncestor() |
|
| 28 | + { |
|
| 29 | + return $this->ancestor; |
|
| 30 | + } |
|
| 31 | + /** |
|
| 32 | + * @param Location $location |
|
| 33 | + */ |
|
| 34 | + public function setAncestor($ancestor) |
|
| 35 | + { |
|
| 36 | + if(isset($ancestor) && $ancestor != "") |
|
| 37 | + { |
|
| 38 | 38 | $this->ancestor = $ancestor; |
| 39 | 39 | } |
| 40 | - } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - function getApiEndPoint() |
|
| 43 | - { |
|
| 44 | - return '/v3/posts/'; |
|
| 45 | - } |
|
| 46 | - function getPayload() |
|
| 47 | - { |
|
| 48 | - return array( |
|
| 42 | + function getApiEndPoint() |
|
| 43 | + { |
|
| 44 | + return '/v3/posts/'; |
|
| 45 | + } |
|
| 46 | + function getPayload() |
|
| 47 | + { |
|
| 48 | + return array( |
|
| 49 | 49 | "ancestor" => $this->getAncestor(), |
| 50 | 50 | "color" => "9EC41C", |
| 51 | - "location" => $this->getLocation()->toArray(), |
|
| 52 | - "message" => $_POST['message'], |
|
| 53 | - ); |
|
| 54 | - } |
|
| 55 | - function getMethod() |
|
| 56 | - { |
|
| 57 | - return 'POST'; |
|
| 58 | - } |
|
| 51 | + "location" => $this->getLocation()->toArray(), |
|
| 52 | + "message" => $_POST['message'], |
|
| 53 | + ); |
|
| 54 | + } |
|
| 55 | + function getMethod() |
|
| 56 | + { |
|
| 57 | + return 'POST'; |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -2,51 +2,51 @@ |
||
| 2 | 2 | |
| 3 | 3 | class Location{ |
| 4 | 4 | |
| 5 | - public $cityName; |
|
| 6 | - |
|
| 7 | - public $lat; |
|
| 8 | - |
|
| 9 | - public $lng; |
|
| 10 | - |
|
| 11 | - public function getCityName() |
|
| 12 | - { |
|
| 13 | - return $this->cityName; |
|
| 14 | - } |
|
| 15 | - |
|
| 16 | - public function setCityName($cityName) |
|
| 17 | - { |
|
| 18 | - $this->cityName = $cityName; |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public function getLat() |
|
| 22 | - { |
|
| 23 | - return $this->lat; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function setLat($lat) |
|
| 27 | - { |
|
| 28 | - $this->lat = $lat; |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - public function getLng() |
|
| 32 | - { |
|
| 33 | - return $this->lng; |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - public function setLng($lng) |
|
| 37 | - { |
|
| 38 | - $this->lng = $lng; |
|
| 39 | - } |
|
| 40 | - public function toArray(){ |
|
| 41 | - return array( |
|
| 42 | - "city" => $this->getCityName(), |
|
| 43 | - "country" => 'DE', |
|
| 44 | - "loc_accuracy" => '0.0', |
|
| 45 | - "loc_coordinates" => array( |
|
| 46 | - "lat" => $this->getLat(), |
|
| 47 | - "lng" => $this->getLng(), |
|
| 48 | - ), |
|
| 49 | - "name" => $this->getCityName() |
|
| 50 | - ); |
|
| 51 | - } |
|
| 5 | + public $cityName; |
|
| 6 | + |
|
| 7 | + public $lat; |
|
| 8 | + |
|
| 9 | + public $lng; |
|
| 10 | + |
|
| 11 | + public function getCityName() |
|
| 12 | + { |
|
| 13 | + return $this->cityName; |
|
| 14 | + } |
|
| 15 | + |
|
| 16 | + public function setCityName($cityName) |
|
| 17 | + { |
|
| 18 | + $this->cityName = $cityName; |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public function getLat() |
|
| 22 | + { |
|
| 23 | + return $this->lat; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function setLat($lat) |
|
| 27 | + { |
|
| 28 | + $this->lat = $lat; |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + public function getLng() |
|
| 32 | + { |
|
| 33 | + return $this->lng; |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + public function setLng($lng) |
|
| 37 | + { |
|
| 38 | + $this->lng = $lng; |
|
| 39 | + } |
|
| 40 | + public function toArray(){ |
|
| 41 | + return array( |
|
| 42 | + "city" => $this->getCityName(), |
|
| 43 | + "country" => 'DE', |
|
| 44 | + "loc_accuracy" => '0.0', |
|
| 45 | + "loc_coordinates" => array( |
|
| 46 | + "lat" => $this->getLat(), |
|
| 47 | + "lng" => $this->getLng(), |
|
| 48 | + ), |
|
| 49 | + "name" => $this->getCityName() |
|
| 50 | + ); |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -3,37 +3,37 @@ |
||
| 3 | 3 | |
| 4 | 4 | class UpdateLocation extends AbstractRequest { |
| 5 | 5 | /** |
| 6 | - * @var Location |
|
| 7 | - */ |
|
| 8 | - public $location; |
|
| 9 | - /** |
|
| 10 | - * @return Location |
|
| 11 | - */ |
|
| 12 | - public function getLocation() |
|
| 13 | - { |
|
| 14 | - return $this->location; |
|
| 15 | - } |
|
| 16 | - /** |
|
| 17 | - * @param Location $location |
|
| 18 | - */ |
|
| 19 | - public function setLocation($location) |
|
| 20 | - { |
|
| 21 | - $this->location = $location; |
|
| 22 | - } |
|
| 6 | + * @var Location |
|
| 7 | + */ |
|
| 8 | + public $location; |
|
| 9 | + /** |
|
| 10 | + * @return Location |
|
| 11 | + */ |
|
| 12 | + public function getLocation() |
|
| 13 | + { |
|
| 14 | + return $this->location; |
|
| 15 | + } |
|
| 16 | + /** |
|
| 17 | + * @param Location $location |
|
| 18 | + */ |
|
| 19 | + public function setLocation($location) |
|
| 20 | + { |
|
| 21 | + $this->location = $location; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - function getApiEndPoint() |
|
| 25 | - { |
|
| 26 | - return '/v2/users/location'; |
|
| 27 | - } |
|
| 28 | - function getPayload() |
|
| 29 | - { |
|
| 30 | - return array( |
|
| 24 | + function getApiEndPoint() |
|
| 25 | + { |
|
| 26 | + return '/v2/users/location'; |
|
| 27 | + } |
|
| 28 | + function getPayload() |
|
| 29 | + { |
|
| 30 | + return array( |
|
| 31 | 31 | "location" => $this->getLocation()->toArray(), |
| 32 | - ); |
|
| 33 | - } |
|
| 34 | - function getMethod() |
|
| 35 | - { |
|
| 36 | - return 'PUT'; |
|
| 37 | - } |
|
| 32 | + ); |
|
| 33 | + } |
|
| 34 | + function getMethod() |
|
| 35 | + { |
|
| 36 | + return 'PUT'; |
|
| 37 | + } |
|
| 38 | 38 | } |
| 39 | 39 | |