Skip to main content

GravityKit\GravityView\Form\FormCollection

A collection of \GV\Form objects.

Since:

  • 2.0
  • 3.0.0 (Migrated to GravityKit\GravityView\Form namespace.)

Source: src/Form/FormCollection.php:21

Details

  • Kind: class
  • Namespace: GravityKit\GravityView\Form
  • Extends: GV\Collection

Methods

MethodDescription
add()Add a \GV\Form to this collection.
get()Get a \GV\Form from this list.

Method Reference

add()

public function add( $form )

Add a \GV\Form to this collection.

Parameters

NameTypeDefaultDescription
$form\GV\FormThe form to add to the internal array.

Returns

  • void

Since: 2.0

Source: src/Form/FormCollection.php:31

get()

public function get( $form_id, $backend='gravityforms' )

Get a \GV\Form from this list.

Parameters

NameTypeDefaultDescription
$form_idintThe ID of the form to get.
$backendstring'gravityforms'The form backend identifier, allows for multiple form backends in the future. Unused until then.

Returns

  • \GV\Form | null — The \GV\Form with the $form_id as the ID, or null if not found.

Since: 2.0

Source: src/Form/FormCollection.php:50