# jetformbuilder/3.6.6/components/rest-api/rest-endpoint.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 32 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/components/rest-api/rest-endpoint.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/components/rest-api/rest-endpoint.php
- Modified: 2023-11-20T11:46:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/components/rest-api/rest-endpoint.php#L10-L20`.

```php
<?php


namespace JFB_Components\Rest_Api;

use Jet_Form_Builder\Classes\Arrayable\Arrayable;
use JFB_Components\Rest_Api\Traits\Rest_Fetch_Endpoint;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Rest_Endpoint implements Arrayable {

	private $url;
	private $method;

	public function __construct( Rest_Fetch_Endpoint $endpoint ) {
		$this->url    = $endpoint->get_rest_url();
		$this->method = $endpoint->get_rest_methods();
	}

	public function to_array(): array {
		return array(
			'url'    => $this->url,
			'method' => $this->method,
		);
	}

}

```
