GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Static Public Member Functions
GravityView_GFFormsModel Class Reference

Make some GFFormsModel public available. More...

Inheritance diagram for GravityView_GFFormsModel:

Static Public Member Functions

static copy_post_image ( $url, $post_id)
 Copied function from Gravity Forms plugin ::copy_post_image since the method is private. More...
 
static get_database_version ()
 Make sure the method exists, regardless of GF version. More...
 
static get_post_field_images ( $form, $entry)
 Given information provided in an entry, get array of media IDs. More...
 
static get_post_fields ( $form, $entry)
 Alias of GFFormsModel::get_post_fields(); just making it public. More...
 
static is_value_match ( $field_value, $target_value, $operation='is', $source_field=null, $rule=null, $form=null)
 Determines if the field value matches the conditional logic rule value. More...
 
static media_handle_upload ( $url, $post_id, $post_data=array())
 Copied function from Gravity Forms plugin ::media_handle_upload since the method is private. More...
 

Detailed Description

Make some GFFormsModel public available.

Since
1.16.2

Definition at line 8 of file class-gravityview-gfformsmodel.php.

Member Function Documentation

◆ copy_post_image()

static copy_post_image (   $url,
  $post_id 
)
static

Copied function from Gravity Forms plugin ::copy_post_image since the method is private.

Since
1.16.2
Parameters
string$urlURL of the post image to update
int$post_idID of the post image to update
Returns
array|bool Array with file, url and type keys. False: failed to copy file to final directory path.

If the method changes to public, use Gravity Forms' method

Definition at line 135 of file class-gravityview-gfformsmodel.php.

References $url.

◆ get_database_version()

static get_database_version ( )
static

Make sure the method exists, regardless of GF version.

Since
1.22.2
Returns
string|false False if not set, version string otherwise

Definition at line 17 of file class-gravityview-gfformsmodel.php.

Referenced by GravityView_Entry_Notes\get_note(), Plugin\uninstall(), GravityView_Edit_Entry_Render\unset_hidden_field_values(), and GravityView_Edit_Entry_Render\update_calculation_fields().

◆ get_post_field_images()

static get_post_field_images (   $form,
  $entry 
)
static

Given information provided in an entry, get array of media IDs.

This is necessary because GF doesn't expect to need to update post images, only to create them.

See also
GFFormsModel::create_post()
Since
1.17
Parameters
array$formGravity Forms form array
array$entryGravity Forms entry array
Returns
array Array of "Field ID" => "Media IDs"

Definition at line 73 of file class-gravityview-gfformsmodel.php.

References $entry, and GV\$form.

Referenced by GravityView_Edit_Entry_Render\fill_post_template().

◆ get_post_fields()

static get_post_fields (   $form,
  $entry 
)
static

Alias of GFFormsModel::get_post_fields(); just making it public.

See also
GFFormsModel::get_post_fields()
Since
1.17
Parameters
array$formGravity Forms form array
array$entryGravity Forms entry array
Returns
array

If the method changes to public, use Gravity Forms' method

Definition at line 108 of file class-gravityview-gfformsmodel.php.

References $entry, and GV\$form.

◆ is_value_match()

static is_value_match (   $field_value,
  $target_value,
  $operation = 'is',
  $source_field = null,
  $rule = null,
  $form = null 
)
static

Determines if the field value matches the conditional logic rule value.

Since
1.22.3
Parameters
mixed$field_valueThe field value to be checked.
mixed$target_valueThe conditional logic rule value.
string$operationThe conditional logic rule operator.
null | GF_Field | string$source_fieldThe field the rule is based on, or the entry meta
null | array$ruleThe conditional logic rule properties.
null | array$formThe current form.
Returns
bool

Definition at line 40 of file class-gravityview-gfformsmodel.php.

References $field_value, GV\$form, and GVCommon\matches_operation().

◆ media_handle_upload()

static media_handle_upload (   $url,
  $post_id,
  $post_data = array() 
)
static

Copied function from Gravity Forms plugin ::media_handle_upload since the method is private.

Note: The method became public in GF 1.9.17.7

See also
GFFormsModel::media_handle_upload
GravityView_Edit_Entry_Render::maybe_update_post_fields

copy_post_image wp_insert_attachment wp_update_attachment_metadata

Parameters
string$urlURL of the post image to update
int$post_idID of the post image to update
array$post_dataArray of data for the eventual attachment post type that is created using {
See also
wp_insert_attachment}. Supports post_mime_type, guid, post_parent, post_title, post_content keys.
Returns
bool|int ID of attachment Post created. Returns false if file not created by copy_post_image

If the method changes to public, use Gravity Forms' method

Definition at line 170 of file class-gravityview-gfformsmodel.php.

References $url.

Referenced by GravityView_Edit_Entry_Render\update_post_image().


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