GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Protected Member Functions | Protected Attributes
Route Class Reference

If this file is called directly, abort. More...

Inheritance diagram for Route:
Views_Route

Public Member Functions

 __call ( $method, $args)
 Fallback if subclass doesn't define routes. More...
 
 create_item ( $request)
 Create one item from the collection. More...
 
 create_item_permissions_check ( $request)
 Check if a given request has access to create items. More...
 
 create_sub_item ( $request)
 Create one item from the collection. More...
 
 delete_item ( $request)
 Delete one item from the collection. More...
 
 delete_item_permissions_check ( $request)
 Check if a given request has access to delete a specific item. More...
 
 delete_sub_item ( $request)
 Delete one item from the collection for sub items. More...
 
 get_item ( $request)
 Get one item from the collection. More...
 
 get_item_permissions_check ( $request)
 Check if a given request has access to get a specific item. More...
 
 get_items ( $request)
 Get a collection of items. More...
 
 get_items_permissions_check ( $request)
 Check if a given request has access to get items. More...
 
 get_sub_item ( $request)
 Get one item from the collection. More...
 
 get_sub_items ( $request)
 Get a collection of items. More...
 
 prepare_item_for_response ( $item, $request)
 Prepare the item for the REST response. More...
 
 register_routes ()
 Register the routes for the objects of the controller. More...
 
 update_item ( $request)
 Update one item from the collection. More...
 
 update_item_permissions_check ( $request)
 Check if a given request has access to update a specific item. More...
 
 update_sub_item ( $request)
 Update one item from the collection for sub items. More...
 

Protected Member Functions

 get_route_name ()
 Get route name. More...
 
 get_sub_type ()
 Get sub_type. More...
 
 not_implemented ()
 Generic response for routes not yet implemented. More...
 
 prepare_item_for_database ( $request)
 Prepare the item for create or update operation. More...
 

Protected Attributes

 $route_name
 
 $sub_type
 

Detailed Description

If this file is called directly, abort.

Definition at line 18 of file class-gv-rest-route.php.

Member Function Documentation

◆ __call()

__call (   $method,
  $args 
)

Fallback if subclass doesn't define routes.

Returns empty array for args instead of making an error.

Since
2.0
Parameters
$method
Returns
array

Definition at line 404 of file class-gv-rest-route.php.

◆ create_item()

create_item (   $request)

Create one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 233 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ create_item_permissions_check()

create_item_permissions_check (   $request)

Check if a given request has access to create items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 335 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ create_sub_item()

create_sub_item (   $request)

Create one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 285 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ delete_item()

delete_item (   $request)

Delete one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 253 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ delete_item_permissions_check()

delete_item_permissions_check (   $request)

Check if a given request has access to delete a specific item.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 355 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ delete_sub_item()

delete_sub_item (   $request)

Delete one item from the collection for sub items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 305 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_item()

get_item (   $request)

Get one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns
|

Definition at line 223 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_item_permissions_check()

get_item_permissions_check (   $request)

Check if a given request has access to get a specific item.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 325 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_items()

get_items (   $request)

Get a collection of items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns
|

Definition at line 213 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_items_permissions_check()

get_items_permissions_check (   $request)

Check if a given request has access to get items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 315 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_route_name()

get_route_name ( )
protected

Get route name.

MUST SET route_name property in subclass!

Since
2.0 protected
Returns
string

Definition at line 180 of file class-gv-rest-route.php.

References Route\$route_name.

Referenced by Route\register_routes().

◆ get_sub_item()

get_sub_item (   $request)

Get one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns
|

Definition at line 275 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ get_sub_items()

get_sub_items (   $request)

Get a collection of items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns
|

Definition at line 264 of file class-gv-rest-route.php.

References Route\not_implemented().

Referenced by Views_Route\prepare_entry_for_response().

◆ get_sub_type()

get_sub_type ( )
protected

Get sub_type.

MUST SET sub_type property in subclass!

Since
2.0 protected
Returns
string

Definition at line 198 of file class-gv-rest-route.php.

References Route\$sub_type.

Referenced by Route\register_routes().

◆ not_implemented()

not_implemented ( )
protected

◆ prepare_item_for_database()

prepare_item_for_database (   $request)
protected

Prepare the item for create or update operation.

Parameters
\WP_REST_Request$requestRequest object
Returns

Definition at line 366 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ prepare_item_for_response()

prepare_item_for_response (   $item,
  $request 
)

Prepare the item for the REST response.

Since
2.0
Parameters
mixed$itemWordPress representation of the item.
\WP_REST_Request$requestRequest object.
Returns

Definition at line 380 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ register_routes()

register_routes ( )

Register the routes for the objects of the controller.

Definition at line 40 of file class-gv-rest-route.php.

References $format, Route\$sub_type, Core\get_namespace(), Route\get_route_name(), and Route\get_sub_type().

◆ update_item()

update_item (   $request)

Update one item from the collection.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 243 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ update_item_permissions_check()

update_item_permissions_check (   $request)

Check if a given request has access to update a specific item.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 345 of file class-gv-rest-route.php.

References Route\not_implemented().

◆ update_sub_item()

update_sub_item (   $request)

Update one item from the collection for sub items.

Parameters
\WP_REST_Request$requestFull data about the request.
Returns

Definition at line 295 of file class-gv-rest-route.php.

References Route\not_implemented().

Field Documentation

◆ $route_name

$route_name
protected

Definition at line 26 of file class-gv-rest-route.php.

Referenced by Route\get_route_name().

◆ $sub_type

$sub_type
protected

Definition at line 35 of file class-gv-rest-route.php.

Referenced by Route\get_sub_type(), and Route\register_routes().


The documentation for this class was generated from the following file: