EO_Booking_Form
Pro
The Booking Form class
This should be instaniated via EO_Booking_Form_Factory
Methods
public |
#
__construct( $parameters )
Forms should be instantiated via EO_Booking_Form_Factory
$parameters is an array which must have an 'id' index (form ID), other
keys that can be used:
- 'title',
- 'notice_classes' //this maybe deprecated, it pertains to the form view
- 'error_classes' //this maybe deprecated, it pertains to the form view
- 'button_text' //deprecated. Change property of button element instead
- 'button_classes' //deprecated. Change property of button element instead
|
public |
#
get_type_name( )
|
public |
#
add_element( $element, $settings )
Add an element to the form.
$element may be an instance of @see{iEO_Booking_Form_Element} or JSON array
specifying an element type (input , select , radio etc)
|
public |
#
remove_element( $element_id )
Remove an element from the form.
|
public |
#
get_element( $element_id )
Get the specified form element.
This method looks in nested elements too.
|
public |
#
get_elements( )
Returns an array of form elements
|
public |
#
flatten_elements( )
Returns all elements in the form in a flattened array
|
public |
#
save( $booking_id )
Method for saving received data to the database.
Loops through each of the form's elements calling their save method,
passing the booking ID associated with the form submission.
|
public |
#
get_form_notice_classes( )
Returns the classes added to the form notices
|
public |
#
get_form_error_classes( )
Returns the classes added to the error messages Will be deprecated. Pertains to form view
|
public |
#
get_form_title( )
Get the user-specified option for the booking section title.
|
public |
#
is_simple_booking_mode( )
Is the form option set to 'simple booking mode'
|
public |
#
form_hidden_fields( )
Deprecated. Kept for backwards compatability. Do not use.
|
public |
#
get_view( )
Deprecated. Kept for backwards compatability. Do not use.
|
public |
#
get_form_button_text( )
Returns the booking submit button text
|
public |
#
get_form_button_classes( )
Returns the classes added to the booking submit button
|
Properties
public
|
$id
|
The form's ID (post ID)
|
public
|
$elements
|
Array of EO_Booking_Form_Element
|
public
|
$errors
|
WP_Error object containing errors from the user submission.
|
protected
|
$parameters
|
Array of parameters. Currently used for
|
Hooks