| @@ 8-51 (lines=44) @@ | ||
| 5 | use JulianoBailao\DomusApi\Contracts\GetContract; |
|
| 6 | use JulianoBailao\DomusApi\Core\Endpoint; |
|
| 7 | ||
| 8 | class Models extends Endpoint implements GetContract |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * The brand id. |
|
| 12 | * |
|
| 13 | * @var int |
|
| 14 | */ |
|
| 15 | protected $brandId; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Create a new Models instance. |
|
| 19 | * |
|
| 20 | * @param int $brandId |
|
| 21 | */ |
|
| 22 | public function __construct($client, $brandId) |
|
| 23 | { |
|
| 24 | parent::__construct($client); |
|
| 25 | $this->brandId = $brandId; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Get a page of models list. |
|
| 30 | * |
|
| 31 | * @param array $query the request query string. |
|
| 32 | * |
|
| 33 | * @return stdObject |
|
| 34 | */ |
|
| 35 | public function paginate(array $query = []) |
|
| 36 | { |
|
| 37 | return $this->page('operacional/marcas/'.$this->brandId.'/modelos', $query); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Get a specific model. |
|
| 42 | * |
|
| 43 | * @param int $id the model id. |
|
| 44 | * |
|
| 45 | * @return stdObject |
|
| 46 | */ |
|
| 47 | public function get($id) |
|
| 48 | { |
|
| 49 | return $this->run('GET', 'operacional/marcas/'.$this->brandId.'/modelos/'.$id); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 8-51 (lines=44) @@ | ||
| 5 | use JulianoBailao\DomusApi\Contracts\GetContract; |
|
| 6 | use JulianoBailao\DomusApi\Core\Endpoint; |
|
| 7 | ||
| 8 | class Subcategories extends Endpoint implements GetContract |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * The category id. |
|
| 12 | * |
|
| 13 | * @var int |
|
| 14 | */ |
|
| 15 | protected $categoryId; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * Create a new Subcategories instance. |
|
| 19 | * |
|
| 20 | * @param int $categoryId |
|
| 21 | */ |
|
| 22 | public function __construct($client, $categoryId) |
|
| 23 | { |
|
| 24 | parent::__construct($client); |
|
| 25 | $this->categoryId = $categoryId; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Get a page of subcategories list. |
|
| 30 | * |
|
| 31 | * @param array $query the request query string. |
|
| 32 | * |
|
| 33 | * @return stdObject |
|
| 34 | */ |
|
| 35 | public function paginate(array $query = []) |
|
| 36 | { |
|
| 37 | return $this->page('operacional/categorias/'.$this->categoryId.'/subcategorias', $query); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Get a specific subcategory. |
|
| 42 | * |
|
| 43 | * @param int $id the subcategory id. |
|
| 44 | * |
|
| 45 | * @return stdObject |
|
| 46 | */ |
|
| 47 | public function get($id) |
|
| 48 | { |
|
| 49 | return $this->run('GET', 'operacional/categorias/'.$this->categoryId.'/subcategorias/'.$id); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||