Workflow:
- generateBookingForm() -> creates the booking form with the general fields
- customForms() -> creates the custom event forms with the custom event booking fields
- bookings() -> migrates the bookings
- files() -> migrates files
Methods
Migrate bookings
bookings() : array
Old format:
FieldId : { "key": identifier : value }
New format:
FieldId : value :
Exceptions
Returns
array
Of errors
Migrate files from #__matukio to #__matukio_files
files() : boolean
Exceptions
\Exception |
If file could not be stored |
Returns
boolean
Finalize the booking
finalize() : void
Gets the select options
getSelectValues(string $params) : mixed
deprecated |
7.0 - Just there for the migration, will be removed soon |
Parameters
Returns
mixed
Get the total items
getTotal() : void
Migration control, calls the tasks which are supplied as action
migrate() : void
Prepare the general booking form etc.
preparation() : void
Reset the form and field table
reset() : void
Copy the general booking fields to the new form
copyGeneralFields(array $fields, integer $formId) : integer
Parameters
$fields
array
Array of general Fields
$formId
integer
The Form Id
Returns
integer
Highest ordering of the copied fields
Create Fees Field
createMatukioFeesField() : \stdClass
Get a new Booking fields from an old one
createNewBookingField(object $oldBookingField, string $agb = null
, string $revoke = null
) : \stdClass
Parameters
$oldBookingField
object
Old booking field
$revoke
string
Revoke text
Returns
\stdClass
Get the old booking fields
getOldBookingfields() : array | null
Exceptions
Returns
array
null
Get the mapping of the old field id against the new one
getOldNewIdMapping($fields) : array
Parameters
$fields
Exceptions
Returns
array
Get the Total count for a table
getTableTotal(string $table) : mixed
Parameters
$table
string
Table (#__matukio)
Returns
mixed
Get a unique ordering id.
getUniqueOrdering(integer $ordering) : integer
. Tries to keep the current one if possible
Parameters
$ordering
integer
The id to check if it is unique
Returns
integer
a unique ordering
Has the event custom fields
hasCustomFields(integer $eventId) : integer
Parameters
$eventId
integer
The recurring event id
Returns
integer
Get the new booking field for the old custom one
mapOldZusatzToNewField(string $zusatz, string $zusatzHint, string $zusatzShow, integer $ordering, integer $formId, integer $nr) : \stdClass
Parameters
$zusatz
string
The string Address|1||text
$zusatzHint
string
Tooltip
$zusatzShow
string
Not sure if that is used..
$ordering
integer
Ordering of the field
$formId
integer
FormId of the new field
$nr
integer
Old Zusatz Nr (for mapping bookings)
Exceptions
Returns
\stdClass
New field
Save booking
saveBooking($booking) : boolean
Parameters
$booking
Exceptions
Returns
boolean
Save a booking field in the new form
saveField(object $field) : boolean
Parameters
$field
object
The new field
Exceptions
Returns
boolean
Get a label translation placeholder
translatableLabel(string $label) : string
Parameters
$label
string
Label String
Returns
string
Translate the component
translateComponent(string $type, string $identifier = ''
) : string
Parameters
$type
string
The field type
$identifier
string
The identifier
Exceptions
\Exception |
If unknown field type |
Returns
string
The new mapping
Translate the data source mapping
translateMapping(integer $datasource, string $datasource_map) : \stdClass
Parameters
$datasource
integer
The old data source (0 = none, 1 = joomla_profile, 2 = CB)
$datasource_map
string
The target field
Returns
\stdClass
The new mapping
Translate options (select, radio, checkbox)
translateOptions(array|string $options) : array | string
Parameters
$options
array
string
The old ordering
Returns
array
string
The new ordering
Properties
Mapping for the component
$componentMapping : array
Default
array('text' => 'FieldInputText', 'textarea' => 'FieldInputTextarea', 'select' => 'FieldInputSelect', 'radio' => 'FieldInputRadio', 'checkbox' => 'FieldInputCheckbox', 'spacer' => 'FieldSpacer', 'spacertext' => 'FieldSpacerText', 'terms' => 'FieldTerms', 'matukiofees' => 'FieldMatukioFees')
Static
Contains all ordering values, to make sure they are unique
$orders : array