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

Class GravityView_Entry_Notes. More...

Public Member Functions

 __construct ()
 GravityView_Entry_Notes constructor. More...
 

Static Public Member Functions

static add_note ( $lead_id, $user_id, $user_name, $note='', $note_type='gravityview')
 Alias for GFFormsModel::add_note() with default note_type of 'gravityview'. More...
 
static delete_note ( $note_id)
 Alias for GFFormsModel::delete_note() More...
 
static delete_notes ( $note_ids=array())
 Delete an array of notes Alias for GFFormsModel::delete_notes() More...
 
static filter_avatar ( $avatar='', $note=null)
 Use the GravityView avatar for notes created by GravityView Note: The function is static so that it's easier to remove the filter: `remove_filter( 'gform_notes_avatar', array( 'GravityView_Entry_Notes', 'filter_avatar' ) );`. More...
 
static get_note ( $note_id)
 Get a single note by note ID. More...
 
static get_notes ( $entry_id)
 Alias for GFFormsModel::get_lead_notes() More...
 

Private Member Functions

 add_hooks ()
 

Detailed Description

Class GravityView_Entry_Notes.

Since
1.15

Definition at line 15 of file class-gravityview-entry-notes.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

GravityView_Entry_Notes constructor.

Definition at line 20 of file class-gravityview-entry-notes.php.

References add_hooks().

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private
Since
1.15

Definition at line 27 of file class-gravityview-entry-notes.php.

Referenced by __construct().

◆ add_note()

static add_note (   $lead_id,
  $user_id,
  $user_name,
  $note = '',
  $note_type = 'gravityview' 
)
static

Alias for GFFormsModel::add_note() with default note_type of 'gravityview'.

See also
GFFormsModel::add_note()
Since
1.15
1.17 Added return value
Parameters
int$lead_idID of the Entry
int$user_idID of the user creating the note
string$user_nameUser name of the user creating the note
string$noteNote content.
string$note_typeType of note. Default: gravityview
Returns
int|WP_Error Note ID, if success. WP_Error with $wpdb->last_error message, if failed.
Runs Filter:
gravityview/entry_notes/add_note Modify note values before added using GFFormsModel::add_note()
See also
GFFormsModel::add_note
Since
1.15.2
Parameters
array$noteArray with lead_id, user_id, user_name, note, and note_type key value pairs

Definition at line 48 of file class-gravityview-entry-notes.php.

Referenced by GravityView_Entry_Approval\add_approval_status_updated_note(), GravityView_Field_Notes\add_note(), GravityView_Change_Entry_Creator\assign_new_user_to_lead(), and GravityView_Change_Entry_Creator\update_entry_creator().

◆ delete_note()

static delete_note (   $note_id)
static

Alias for GFFormsModel::delete_note()

See also
GFFormsModel::delete_note()
Parameters
int$note_idEntry note ID

Definition at line 87 of file class-gravityview-entry-notes.php.

◆ delete_notes()

static delete_notes (   $note_ids = array())
static

Delete an array of notes Alias for GFFormsModel::delete_notes()

Parameters
int[]$note_ids Array of entry note ids

Definition at line 97 of file class-gravityview-entry-notes.php.

References gravityview().

Referenced by GravityView_Field_Notes\process_delete_notes().

◆ filter_avatar()

static filter_avatar (   $avatar = '',
  $note = null 
)
static

Use the GravityView avatar for notes created by GravityView Note: The function is static so that it's easier to remove the filter: `remove_filter( 'gform_notes_avatar', array( 'GravityView_Entry_Notes', 'filter_avatar' ) );`.

Since
1.15
Parameters
string$avatarAvatar image, if available. 48px x 48px by default.
object$noteNote object with id, user_id, date_created, value, note_type, user_name, user_email vars.
Returns
string Possibly-modified avatar.

Definition at line 171 of file class-gravityview-entry-notes.php.

References GRAVITYVIEW_FILE.

◆ get_note()

static get_note (   $note_id)
static

Get a single note by note ID.

Since
1.17
Parameters
int$note_idThe ID of the note in the {prefix}_rg_lead_notes table
Returns
object|bool False if not found; note object otherwise.

Definition at line 141 of file class-gravityview-entry-notes.php.

References GravityView_GFFormsModel\get_database_version().

Referenced by GravityView_Field_Notes\process_add_note().

◆ get_notes()

static get_notes (   $entry_id)
static

Alias for GFFormsModel::get_lead_notes()

See also
GFFormsModel::get_lead_notes
Parameters
int$entry_idEntry to get notes for
Returns
stdClass[]|null Integer-keyed array of note objects
Runs Filter:
gravityview/entry_notes/get_notes Modify the notes array for an entry
Since
1.15
Parameters
stdClass[]|null$notes Integer-keyed array of note objects
int$entry_idEntry to get notes for

Definition at line 117 of file class-gravityview-entry-notes.php.

References $notes.


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