| @@ 9-46 (lines=38) @@ | ||
| 6 | use JulianoBailao\DomusApi\Core\Endpoint; |
|
| 7 | use JulianoBailao\DomusApi\Endpoints\Secondary\Models; |
|
| 8 | ||
| 9 | class Brands extends Endpoint implements GetContract |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * Get a page of brands list. |
|
| 13 | * |
|
| 14 | * @param array $query the request query string. |
|
| 15 | * |
|
| 16 | * @return stdObject |
|
| 17 | */ |
|
| 18 | public function paginate(array $query = []) |
|
| 19 | { |
|
| 20 | return $this->page('operacional/marcas', $query); |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Get a specific brand. |
|
| 25 | * |
|
| 26 | * @param int $id the brand id. |
|
| 27 | * |
|
| 28 | * @return stdObject |
|
| 29 | */ |
|
| 30 | public function get($id) |
|
| 31 | { |
|
| 32 | return $this->run('GET', 'operacional/marcas/'.$id); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Get the Models endpoint from a brand. |
|
| 37 | * |
|
| 38 | * @param int $brandId |
|
| 39 | * |
|
| 40 | * @return Models |
|
| 41 | */ |
|
| 42 | public function models($brandId) |
|
| 43 | { |
|
| 44 | return new Models($this->client, $brandId); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 9-46 (lines=38) @@ | ||
| 6 | use JulianoBailao\DomusApi\Core\Endpoint; |
|
| 7 | use JulianoBailao\DomusApi\Endpoints\Secondary\Subcategories; |
|
| 8 | ||
| 9 | class Categories extends Endpoint implements GetContract |
|
| 10 | { |
|
| 11 | /** |
|
| 12 | * Get a page of categories list. |
|
| 13 | * |
|
| 14 | * @param array $query the request query string. |
|
| 15 | * |
|
| 16 | * @return stdObject |
|
| 17 | */ |
|
| 18 | public function paginate(array $query = []) |
|
| 19 | { |
|
| 20 | return $this->page('operacional/categorias', $query); |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Get a specific category. |
|
| 25 | * |
|
| 26 | * @param int $id the category id. |
|
| 27 | * |
|
| 28 | * @return stdObject |
|
| 29 | */ |
|
| 30 | public function get($id) |
|
| 31 | { |
|
| 32 | return $this->run('GET', 'operacional/categorias/'.$id); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Get the Subcategories endpoint from a category. |
|
| 37 | * |
|
| 38 | * @param int $brandId |
|
| 39 | * |
|
| 40 | * @return Subcategories |
|
| 41 | */ |
|
| 42 | public function subcategories($brandId) |
|
| 43 | { |
|
| 44 | return new Subcategories($this->client, $brandId); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 8-45 (lines=38) @@ | ||
| 5 | use JulianoBailao\DomusApi\Contracts\GetContract; |
|
| 6 | use JulianoBailao\DomusApi\Core\Endpoint; |
|
| 7 | ||
| 8 | class Cities extends Endpoint implements GetContract |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * Get a page of models list. |
|
| 12 | * |
|
| 13 | * @param array $query the request query string. |
|
| 14 | * |
|
| 15 | * @return stdObject |
|
| 16 | */ |
|
| 17 | public function paginate(array $query = []) |
|
| 18 | { |
|
| 19 | return $this->page('operacional/enderecos/localidade', $query); |
|
| 20 | } |
|
| 21 | ||
| 22 | /** |
|
| 23 | * Get a specific model. |
|
| 24 | * |
|
| 25 | * @param int $id the model id. |
|
| 26 | * |
|
| 27 | * @return stdObject |
|
| 28 | */ |
|
| 29 | public function get($id) |
|
| 30 | { |
|
| 31 | return $this->run('GET', 'operacional/enderecos/localidade/'.$id); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Get te Neighborhoods endpoint. |
|
| 36 | * |
|
| 37 | * @param int $cityId |
|
| 38 | * |
|
| 39 | * @return Neighborhoods |
|
| 40 | */ |
|
| 41 | public function neighborhoods($cityId) |
|
| 42 | { |
|
| 43 | return new Neighborhoods($this->client, $cityId); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||