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
arrayOf 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
arrayArray of general Fields
$formId
integerThe Form Id
Returns
integerHighest 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
objectOld booking field
$revoke
stringRevoke text
Returns
\stdClass
Get the old booking fields
getOldBookingfields() : array | null
Exceptions
Returns
arraynull
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
stringTable (#__matukio)
Returns
mixed
Get a unique ordering id.
getUniqueOrdering(integer $ordering) : integer
. Tries to keep the current one if possible
Parameters
$ordering
integerThe id to check if it is unique
Returns
integera unique ordering
Has the event custom fields
hasCustomFields(integer $eventId) : integer
Parameters
$eventId
integerThe 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
stringThe string Address|1||text
$zusatzHint
stringTooltip
$zusatzShow
stringNot sure if that is used..
$ordering
integerOrdering of the field
$formId
integerFormId of the new field
$nr
integerOld Zusatz Nr (for mapping bookings)
Exceptions
Returns
\stdClassNew 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
objectThe new field
Exceptions
Returns
boolean
Get a label translation placeholder
translatableLabel(string $label) : string
Parameters
$label
stringLabel String
Returns
string
Translate the component
translateComponent(string $type, string $identifier = '') : string
Parameters
$type
stringThe field type
$identifier
stringThe identifier
Exceptions
\Exception |
If unknown field type |
Returns
stringThe new mapping
Translate the data source mapping
translateMapping(integer $datasource, string $datasource_map) : \stdClass
Parameters
$datasource
integerThe old data source (0 = none, 1 = joomla_profile, 2 = CB)
$datasource_map
stringThe target field
Returns
\stdClassThe new mapping
Translate options (select, radio, checkbox)
translateOptions(array|string $options) : array | string
Parameters
$options
arraystringThe old ordering
Returns
arraystringThe 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