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

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

Inheritance diagram for Entry:
GF_Entry Multi_Entry

Public Member Functions

 as_entry ()
 Return the backing entry object. More...
 
 from_field ( $field, $fallback=null)
 If this is a Multi_Entry filter it by Field. More...
 
 get_permalink (\GV\View $view=null, \GV\Request $request=null, $track_directory=true)
 Return the link to this entry in the supplied context. More...
 
 get_slug ( $apply_filter=false, \GV\View $view=null, \GV\Request $request=null, $track_directory=true)
 Get the entry slug. More...
 
 is_multi ()
 Is this a multi-entry (joined entry). More...
 

Static Public Member Functions

static add_rewrite_endpoint ()
 Adds the necessary rewrites for single Entries. More...
 
static by_id ( $entry_id)
 Construct a instance by ID. More...
 
static get_endpoint_name ()
 Return the endpoint name for a single Entry. More...
 

Data Fields

 $ID = null
 

Static Public Attributes

static $backend = null
 

Protected Attributes

 $entry
 

Detailed Description

If this file is called directly, abort.

The base class.

Contains all entry data and some processing and logic rules.

Definition at line 14 of file class-gv-entry.php.

Member Function Documentation

◆ add_rewrite_endpoint()

static add_rewrite_endpoint ( )
static

Adds the necessary rewrites for single Entries.

Let's make sure the endpoint array is not polluted.

Definition at line 42 of file class-gv-entry.php.

Referenced by GravityView_Post_Types\init_rewrite().

◆ as_entry()

as_entry ( )

Return the backing entry object.

Returns
array The backing entry object.

Definition at line 91 of file class-gv-entry.php.

References $entry.

◆ by_id()

static by_id (   $entry_id)
static

Construct a instance by ID.

Parameters
int | string$entry_idThe internal entry ID.
Since
2.0
Returns
|null An instance of this entry or null if not found.

Definition at line 82 of file class-gv-entry.php.

◆ from_field()

from_field (   $field,
  $fallback = null 
)

If this is a Multi_Entry filter it by Field.

Since
2.2
Parameters
\GV\Field$fieldThe field to filter by.
int$fallbackA fallback form_id if the field supplied is invalid.
Returns
|null A or null if not found.

Definition at line 251 of file class-gv-entry.php.

References $field.

◆ get_endpoint_name()

static get_endpoint_name ( )
static

Return the endpoint name for a single Entry.

Also used as the query_var for the time being.

Runs Filter:
gravityview_directory_endpoint Change the slug used for single entries
Parameters
string$endpointSlug to use when accessing single entry. Default: entry

Definition at line 63 of file class-gv-entry.php.

Referenced by gravityview\callback(), GravityView_API\entry_link(), oEmbed\get_entry_regex(), Entry\get_permalink(), Views_Route\get_sub_item_permissions_check(), and GravityView_frontend\is_single_entry().

◆ get_permalink()

get_permalink ( \GV\View  $view = null,
\GV\Request  $request = null,
  $track_directory = true 
)

Return the link to this entry in the supplied context.

Since
2.0
Parameters
\GV\View | null$viewThe View context.
\GV\Request$requestThe Request (current if null).
boolean$track_directoryKeep the housing directory arguments intact (used for breadcrumbs, for example). Default: true.
Returns
string The permalink to this entry.

This is not a regular view.

Must be an embed of some sort.

Fallback to regular view base.

Runs Filter:
gravityview_directory_link Modify the URL to the View "directory" context
Since
1.19.4
Parameters
string$linkURL to the View's "directory" context (Multiple Entries screen)
int$post_idID of the post to link to. If the View is embedded, it is the post or page ID

Assemble the permalink.

Make sure the $directory_link doesn't contain any query otherwise it will break when adding the entry slug.

Since
1.16.5
Runs Filter:
gravityview/entry/permalink The permalink of this entry.
Since
2.0
Parameters
string$permalinkThe permalink.
\GV\Entry$entryThe entry we're retrieving it for.
\GV\View | null$viewThe view context.
\GV\Request$requestThe request context.

Definition at line 107 of file class-gv-entry.php.

References $args, $entry_slug, $post, $view_id, Entry\get_endpoint_name(), and gravityview().

◆ get_slug()

get_slug (   $apply_filter = false,
\GV\View  $view = null,
\GV\Request  $request = null,
  $track_directory = true 
)

Get the entry slug.

Runs Filter:
gravityview/entry/slug Modify the entry URL slug as needed.
Since
2.2.1
Parameters
string$entry_slugThe slug, sanitized with sanitize_title()
null | \GV\Entry$thisThe entry object.
null | \GV\View$viewThe view object.
null | \GV\Request$requestThe request.
bool$track_directoryWhether the directory is tracked.

Definition at line 208 of file class-gv-entry.php.

References $entry_slug, and GravityView_API\get_entry_slug().

◆ is_multi()

is_multi ( )

Is this a multi-entry (joined entry).

Since
2.2
Returns
boolean

Definition at line 237 of file class-gv-entry.php.

Field Documentation

◆ $backend

$backend = null
static

Definition at line 21 of file class-gv-entry.php.

◆ $entry

$entry
protected

Definition at line 34 of file class-gv-entry.php.

◆ $ID

$ID = null

Definition at line 29 of file class-gv-entry.php.


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