traits
3 years ago
dynamic-rest-url-trait.php
3 years ago
rest-api-controller-base.php
3 years ago
rest-api-endpoint-base.php
3 years ago
rest-endpoint.php
3 years ago
rest-response.php
3 years ago
rest-endpoint.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Rest_Api; |
| 5 | |
| 6 | |
| 7 | use Jet_Form_Builder\Classes\Arrayable\Arrayable; |
| 8 | use Jet_Form_Builder\Rest_Api\Traits\Rest_Fetch_Endpoint; |
| 9 | |
| 10 | class Rest_Endpoint implements Arrayable { |
| 11 | |
| 12 | private $url; |
| 13 | private $method; |
| 14 | |
| 15 | public function __construct( Rest_Fetch_Endpoint $endpoint ) { |
| 16 | $this->url = $endpoint->get_rest_url(); |
| 17 | $this->method = $endpoint->get_rest_methods(); |
| 18 | } |
| 19 | |
| 20 | public function to_array(): array { |
| 21 | return array( |
| 22 | 'url' => $this->url, |
| 23 | 'method' => $this->method, |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | } |