GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gv-collection-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  * A collection of \GV\Form objects.
11  */
12 class Form_Collection extends Collection {
13  /**
14  * Add a \GV\Form to this collection.
15  *
16  * @param \GV\Form $form The form to add to the internal array.
17  *
18  * @api
19  * @since 2.0
20  * @return void
21  */
22  public function add( $form ) {
23  if ( ! $form instanceof Form ) {
24  gravityview()->log->error( 'Form_Collections can only contain objects of type \GV\Form.' );
25  return;
26  }
27  parent::add( $form );
28  }
29 
30  /**
31  * Get a \GV\Form from this list.
32  *
33  * @param int $form_id The ID of the form to get.
34  * @param string $backend The form backend identifier, allows for multiple form backends in the future. Unused until then.
35  *
36  * @api
37  * @since 2.0
38  *
39  * @return \GV\Form|null The \GV\Form with the $form_id as the ID, or null if not found.
40  */
41  public function get( $form_id, $backend = 'gravityforms' ) {
42  foreach ( $this->all() as $form ) {
43  if ( $form->ID == $form_id ) {
44  return $form;
45  }
46  }
47  return null;
48  }
49 }
If this file is called directly, abort.
if(gravityview() ->plugin->is_GF_25()) $form
If this file is called directly, abort.
add( $form)
Add a to this collection.
if(empty( $created_by)) $form_id
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.