GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gv-form.php
Go to the documentation of this file.
1 <?php
2 namespace GV;
3 
4 /** If this file is called directly, abort. */
5 if ( ! defined( 'GRAVITYVIEW_DIR' ) ) {
6  die();
7 }
8 
9 /**
10  * The \GV\Form class.
11  *
12  * Houses all base Form functionality and provides a uniform
13  * API to various form backends via \GV\Form implementations.
14  */
15 abstract class Form extends Source {
16  /**
17  * @var int The ID for this form.
18  *
19  * @api
20  * @since 2.0
21  */
22  public $ID = null;
23 
24  /**
25  * @var array The backing form.
26  */
27  private $form;
28 
29  /**
30  * Construct a \GV\Form instance by ID.
31  *
32  * @param int|string $form_id The internal form ID.
33  *
34  * @api
35  * @since 2.0
36  * @return \GV\Form|null An instance of this form or null if not found.
37  */
38  public static function by_id( $form_id ) {
39  return null;
40  }
41 
42  /**
43  * Get all entries for this form.
44  *
45  * @api
46  * @since 2.0
47  *
48  * @return \GV\Entry_Collection The \GV\Entry_Collection
49  */
50  abstract public function get_entries();
51 
52  /**
53  * Magic shortcuts.
54  *
55  * - `entries` -> `$this->get_entries()`
56  */
57  public function __get( $key ) {
58  switch ( $key ):
59  case 'entries':
60  return $this->get_entries();
61  endswitch;
62  }
63 }
__get( $key)
Magic shortcuts.
If this file is called directly, abort.
static by_id( $form_id)
Construct a instance by ID.
if(empty( $created_by)) $form_id
If this file is called directly, abort.