EO_Booking_Form_Factory
Pro
Handles creation of new and 'existing' (in database) forms.
Ensures the create/retrieved form has the required fields.
Performs backwards-compatability routines for old data sets.
//Existing booking form
$form = EO_Booking_Form_Factory::get_form( $form_id );
//New booking form
$form = EO_Booking_Form_Factory::get_form( array(
'id' => 'my-form-id',
'title' => 'Bookings',
'elements' => array(
'my-element-id' => array(
'type' => 'input',
'label' => 'Foobar'
),
...
)
) );
Methods
public |
#
create( $attributes )
Create a new form from the given attributes
$attributes['elements'] is extracted for creating elements in the
form. Remaining $attributes are passed to EO_Booking_Form::__construct()
|
public |
#
get_form( $form_id )
Retrieve an existing form by ID from the database
|
public |
#
get_event_form( $form_id, $event_id )
Retrieves a booking form for a specific event.
|
Properties
public
|
$forms
|
|
public
|
$event_forms
|
|
Hooks