5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
21 public static $backend =
'gravityforms';
27 if ( ! class_exists(
'GFAPI' ) ) {
28 gravityview()->log->error(
'Gravity Forms plugin not active.' );
46 if ( is_numeric( $entry_id ) ) {
47 $entry = \GFAPI::get_entry( $entry_id );
52 if ( apply_filters(
'gravityview_custom_entry_slug',
false ) ) {
53 return self::by_slug( $entry_id,
$form_id );
59 return self::from_entry(
$entry );
75 if ( version_compare( \GFFormsModel::get_database_version(),
'2.3-dev-1',
'>=' ) ) {
76 $entry_meta = \GFFormsModel::get_entry_meta_table_name();
77 $sql =
"SELECT entry_id FROM $entry_meta";
79 $lead_meta = \GFFormsModel::get_lead_meta_table_name();
80 $sql =
"SELECT lead_id FROM $lead_meta";
83 $sql =
"$sql WHERE meta_key = 'gravityview_unique_id' AND";
86 if (
$form_id = apply_filters(
'gravityview/common/get_entry_id_from_slug/form_id',
$form_id ) ) {
89 $sql = $wpdb->prepare(
"$sql meta_value = %s",
$entry_slug );
92 $entry_id = $wpdb->get_var( $sql );
94 if ( ! is_numeric( $entry_id ) ) {
98 return self::by_id( $entry_id );
109 if ( empty(
$entry[
'id'] ) ) {
116 $self->ID = $self->entry[
'id'];
117 $self->slug = $self->get_slug();
130 #[\ReturnTypeWillChange] 132 return isset( $this->entry[$offset] );
146 #[\ReturnTypeWillChange] 148 return $this->entry[$offset];
160 #[\ReturnTypeWillChange] 162 gravityview()->log->error(
'The underlying Gravity Forms entry is immutable. This is a \GV\Entry object and should not be accessed as an array.' );
173 #[\ReturnTypeWillChange] 175 gravityview()->log->error(
'The underlying Gravity Forms entry is immutable. This is a \GV\Entry object and should not be accessed as an array.' );
static by_slug( $entry_slug, $form_id=0)
Construct a instance by slug name.
__construct()
Initialization.
static from_entry( $entry)
Construct a instance from a Gravity Forms entry array.
offsetExists( $offset)
ArrayAccess compatibility layer with a Gravity Forms entry array.
offsetGet( $offset)
ArrayAccess compatibility layer with a Gravity Forms entry array.
If this file is called directly, abort.
offsetSet( $offset, $value)
ArrayAccess compatibility layer with a Gravity Forms entry array.
if(empty( $created_by)) $form_id
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.
static by_id( $entry_id, $form_id=0)
Construct a instance by ID.
offsetUnset( $offset)
ArrayAccess compatibility layer with a Gravity Forms entry array.