GV\GF_Field
The Gravity Forms {@see \GF_Field} field object wrapper.
Source: future/includes/class-gv-field-gravityforms.php:16
Details
- Kind:
class - Namespace:
GV - Extends:
Field
Properties
| Property | Type | Description |
|---|---|---|
$field | \GF_Field | The backing Gravity Forms field. |
Methods
| Method | Description |
|---|---|
by_id() | Get a \GV\GF_Field by \GV\GF_Form and Field ID. |
get_label() | Retrieve the label for this field. |
get_value() | Retrieve the value for this field. |
__get() | A proxy getter for the backing GravityView field. |
get_ancestors_ids() | Returns all the ancestors for this field, in order from root to this field. |
get_results() | Returns the results this field will produce on the entry. |
Method Reference
by_id()
public static function by_id( $form, $field_id )
Get a \GV\GF_Field by \GV\GF_Form and Field ID.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | \GV\GF_Form | The Gravity Form form. | |
$field_id | int | The Gravity Form field ID for the $form. |
Returns
- \GV\Field |
null— The requested field or null if not found.
Source: future/includes/class-gv-field-gravityforms.php:87
get_label()
public function get_label( View $view=null, Source $source=null, Entry $entry=null, Request $request=null )
Retrieve the label for this field.
Requires a \GV\GF_Form in this implementation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$view | \GV\View | null | The view for this context if applicable. |
$source | \GV\Source | null | The source (form) for this context if applicable. |
$entry | \GV\Entry | null | The entry for this context if applicable. |
$request | \GV\Request | null | The request for this context if applicable. |
Returns
string— The label for this Gravity Forms field.
Source: future/includes/class-gv-field-gravityforms.php:133
get_value()
public function get_value( View $view=null, Source $source=null, Entry $entry=null, Request $request=null )
Retrieve the value for this field.
Requires a \GV\GF_Entry in this implementation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$view | \GV\View | null | The view for this context if applicable. |
$source | \GV\Source | null | The source (form) for this context if applicable. |
$entry | \GV\Entry | null | The entry for this context if applicable. |
$request | \GV\Request | null | The request for this context if applicable. |
Returns
mixed— The value for this field.
Source: future/includes/class-gv-field-gravityforms.php:180
__get()
public function __get( $key )
A proxy getter for the backing GravityView field.
The view field configuration is checked first, though.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key | string | The property to get. |
Returns
mixed— The value of the Gravity View field property, or null if not exists.
Source: future/includes/class-gv-field-gravityforms.php:207
get_ancestors_ids()
public function get_ancestors_ids(): array
Returns all the ancestors for this field, in order from root to this field.
Note: this is for fields that are nested, like repeater fields.
Returns
int[]— The ancestor IDs.
Since: 2.51.0
Source: future/includes/class-gv-field-gravityforms.php:222
get_results()
public function get_results( ?View $view=null, ?Source $source=null, ?Entry $entry=null, ?Request $request=null, string $index='' ): array
Returns the results this field will produce on the entry.
Note: This means that the field is present inside a repeater field, for example. It does not mean the field has multiple values, like a checkbox.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$view | View | null | null | The View object. |
$source | Source | null | null | The Source object. |
$entry | Entry | null | null | The entry object. |
$request | Request | null | null | The Request object. |
$index | string | '' | The nesting index. For example '0', '0.0', '0.1' ,'1.0', '0.0.1', etc. |
Returns
array— The results per index. If no index is provided, returns all results.
Since: 2.51.0
Source: future/includes/class-gv-field-gravityforms.php:238