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

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

Inheritance diagram for Field:
GF_Field Internal_Field

Public Member Functions

 __get ( $key)
 Get one of the extra configuration keys via property accessors. More...
 
 __isset ( $key)
 Is this set? More...
 
 as_configuration ()
 Return an array of the old format as used by callers of GVCommon:get_directory_fields() for example. More...
 
 get_label (View $view=null, Source $source=null, Entry $entry=null, Request $request=null)
 Retrieve the label for this field. More...
 
 get_value (View $view=null, Source $source=null, Entry $entry=null, Request $request=null)
 Retrieve the value for this field. More...
 
 is_visible ( $view=null)
 Whether or not this field is visible. More...
 
 update_configuration ( $configuration)
 Update configuration. More...
 

Static Public Member Functions

static from_configuration ( $configuration)
 Create self from a configuration array. More...
 
static get ( $source, $args)
 An alias for ::get_field() More...
 

Data Fields

 $cap = ''
 
 $custom_class = ''
 
 $custom_label = ''
 
 $ID = ''
 
 $label = ''
 
 $position = ''
 
 $search_filter = false
 
 $show_as_link = false
 
 $show_label = true
 
 $UID = ''
 

Protected Member Functions

 get_value_filters ( $value, View $view=null, Source $source=null, Entry $entry=null, Request $request=null)
 Apply all the required filters after get_value() was called. More...
 

Private Attributes

 $configuration = array()
 

Detailed Description

If this file is called directly, abort.

The default GravityView Field class.

Houses all base Field functionality.

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

Member Function Documentation

◆ __get()

__get (   $key)

Get one of the extra configuration keys via property accessors.

Parameters
string$keyThe key to get.
Returns
mixed|null The value for the given configuration key, null if doesn't exist.

Definition at line 362 of file class-gv-field.php.

◆ __isset()

__isset (   $key)

Is this set?

Parameters
string$keyThe key to get.
Returns
boolean Whether this $key is set or not.

Definition at line 380 of file class-gv-field.php.

◆ as_configuration()

as_configuration ( )

Return an array of the old format as used by callers of GVCommon:get_directory_fields() for example.

'id' => string '9' (length=1) 'label' => string 'Screenshots' (length=11) 'show_label' => string '1' (length=1) 'custom_label' => string '' (length=0) 'custom_class' => string 'gv-gallery' (length=10) 'only_loggedin' => string '0' (length=1) 'only_loggedin_cap' => string 'read' (length=4) 'search_filter' => string '0' 'show_as_link' => string '0'

  • whatever else specific field types may have

Definition at line 121 of file class-gv-field.php.

◆ from_configuration()

static from_configuration (   $configuration)
static

Create self from a configuration array.

Parameters
array$configurationThe configuration array.
See also
::as_configuration()

Prevent infinte loops here from unimplemented children.

| $field_class Determine the field implementation to use, and try to use.

Runs Filter:
gravityview/field/class Filter the field class about to be created from the configuration.
Parameters
string$field_classThe field class about to be used.
array$configurationThe configuration as per ::as_configuration()

| $field

Definition at line 168 of file class-gv-field.php.

References $field, and gravityview().

◆ get()

static get (   $source,
  $args 
)
staticfinal

An alias for ::get_field()

See also
::get_field()
Parameters
string$sourceA class as string this field is tied to.
array$argsThe arguments required for the backend to fetch the field (usually just the ID).
Returns
|null A instance or null if not found.

Definition at line 144 of file class-gv-field.php.

References $args, and gravityview().

◆ get_label()

get_label ( View  $view = null,
Source  $source = null,
Entry  $entry = null,
Request  $request = null 
)

Retrieve the label for this field.

Parameters
\GV\View$viewThe view for this context if applicable.
\GV\Source$sourceThe source (form) for this context if applicable.
\GV\Entry$entryThe entry for this context if applicable.
\GV\Request$requestThe request for this context if applicable.
Returns
string The label for this field. Nothing here.

A custom label is available.

Definition at line 269 of file class-gv-field.php.

References $entry.

◆ get_value()

get_value ( View  $view = null,
Source  $source = null,
Entry  $entry = null,
Request  $request = null 
)

Retrieve the value for this field.

Returns null in this implementation (or, rather, lack thereof).

Parameters
\GV\View$viewThe view for this context if applicable.
\GV\Source$sourceThe source (form) for this context if applicable.
\GV\Entry$entryThe entry for this context if applicable.
\GV\Request$requestThe request for this context if applicable.
Returns
mixed The value for this field.

Definition at line 295 of file class-gv-field.php.

References $entry.

◆ get_value_filters()

get_value_filters (   $value,
View  $view = null,
Source  $source = null,
Entry  $entry = null,
Request  $request = null 
)
protected

Apply all the required filters after get_value() was called.

Parameters
mixed$valueThe value that will be filtered.
\GV\View$viewThe view for this context if applicable.
\GV\Source$sourceThe source (form) for this context if applicable.
\GV\Entry$entryThe entry for this context if applicable.
\GV\Request$requestThe request for this context if applicable.

This is in its own function since subclasses have to call it.

Runs Filter:
gravityview/field/$type/value Override the displayed value here.
Parameters
string$valueThe value.

Definition at line 310 of file class-gv-field.php.

References $entry, and $value.

◆ is_visible()

is_visible (   $view = null)

Whether or not this field is visible.

Parameters
Runs Filter:
gravityview/field/is_visible Should this field be visible?
Parameters
boolean$visibleVisible or not, defaults to the set field capability requirement if defined.
\GV\Field$fieldThe field we're looking at.

Definition at line 344 of file class-gv-field.php.

References GVCommon\has_cap().

◆ update_configuration()

update_configuration (   $configuration)

Update configuration.

Parameters
array$configurationThe configuration array.
See also
::as_configuration()
Since
2.0
Returns
void

Smelling trouble here...

Shared among all field types (sort of).

Everything else goes into the properties for now.

Definition at line 228 of file class-gv-field.php.

References $value, and gravityview().

Field Documentation

◆ $cap

$cap = ''

Definition at line 83 of file class-gv-field.php.

◆ $configuration

$configuration = array()
private

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

◆ $custom_class

$custom_class = ''

Definition at line 73 of file class-gv-field.php.

◆ $custom_label

$custom_label = ''

Definition at line 59 of file class-gv-field.php.

◆ $ID

$ID = ''

Definition at line 45 of file class-gv-field.php.

◆ $label

$label = ''

Definition at line 52 of file class-gv-field.php.

◆ $position

$position = ''

Definition at line 28 of file class-gv-field.php.

◆ $search_filter

$search_filter = false

Definition at line 99 of file class-gv-field.php.

◆ $show_as_link

$show_as_link = false

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

◆ $show_label

$show_label = true

Definition at line 66 of file class-gv-field.php.

◆ $UID

$UID = ''

Definition at line 38 of file class-gv-field.php.


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