Class MatukioControllerMigrate

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
since 7.0.0
package MatukioEvents

 Methods

Migrate bookings

bookings() : array

Old format: FieldId : { "key": identifier : value }

New format: FieldId : value :

since 7.0.0

Exceptions

\Exception TODO refactor

Returns

arrayOf errors

Migrate events with custom booking fields to new forms

customForms() : boolean
since 7.0.0

Exceptions

\Exception

Returns

boolean

Migrate files from #__matukio to #__matukio_files

files() : boolean
since 7.0.0

Exceptions

\Exception If file could not be stored

Returns

boolean

Finalize the booking

finalize() : void
since __DEPLOY_VERSION__

Migrate booking fields and create general booking form

generalBookingForm() : boolean
since 7.0.0

Exceptions

\Exception

Returns

boolean

Gets the select options

getSelectValues(string $params) : mixed
deprecated 7.0 - Just there for the migration, will be removed soon

Parameters

$params

string
  • The values

Returns

mixed

Get the total items

getTotal() : void
since __DEPLOY_VERSION__

Migration control, calls the tasks which are supplied as action

migrate() : void
since __DEPLOY_VERSION__

Prepare the general booking form etc.

preparation() : void
since __DEPLOY_VERSION__

Reset the form and field table

reset() : void
since 7.0.0

Exceptions

\Exception

Copy the general booking fields to the new form

copyGeneralFields(array $fields, integer $formId) : integer
since 7.0.0

Parameters

$fields

array

Array of general Fields

$formId

integer

The Form Id

Returns

integerHighest ordering of the copied fields

Create custom booking form

createCustomEventForm(integer $pages, integer $relationId, $eventName) : boolean
since 7.0.0

Parameters

$pages

integer

Number of bookings

$relationId

integer

Relation to Event

$eventName

Exceptions

\Exception

Returns

boolean

Create the general booking form

createGeneralForm(integer $pages) : boolean
since 7.0.0

Parameters

$pages

integer

Number of pages

Exceptions

\Exception

Returns

boolean

Create Fees Field

createMatukioFeesField() : \stdClass
since 7.0.0

Returns

\stdClassField

Get a new Booking fields from an old one

createNewBookingField(object $oldBookingField, string $agb = null, string $revoke = null) : \stdClass
since 7.0.0

Parameters

$oldBookingField

object

Old booking field

$agb

string

Terms text

$revoke

string

Revoke text

Returns

\stdClass

Get the old booking fields

getOldBookingfields() : array | null
since 7.0.0

Exceptions

\Exception

Returns

arraynull

Get the mapping of the old field id against the new one

getOldNewIdMapping($fields) : array
since 7.0.0

Parameters

$fields

Exceptions

\Exception

Returns

array

Get the Total count for a table

getTableTotal(string $table) : mixed
since __DEPLOY_VERSION__

Parameters

$table

string

Table (#__matukio)

Returns

mixed

Get a unique ordering id.

getUniqueOrdering(integer $ordering) : integer

. Tries to keep the current one if possible

since 7.0.0

Parameters

$ordering

integer

The id to check if it is unique

Returns

integera unique ordering

Has the event custom fields

hasCustomFields(integer $eventId) : integer
since 7.0.0

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
since 7.0.0

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

\Exception

Returns

\stdClassNew field

Save booking

saveBooking($booking) : boolean
since 7.0.0

Parameters

$booking

Exceptions

\Exception

Returns

boolean

Save a booking field in the new form

saveField(object $field) : boolean
since 7.0.0

Parameters

$field

object

The new field

Exceptions

\Exception

Returns

boolean

Saves the form

saveForm(object $form) : integer
since 7.0.0

Parameters

$form

object

Form

Exceptions

\Exception

Returns

integerThe form Id

Get a label translation placeholder

translatableLabel(string $label) : string
since 7.0.0

Parameters

$label

string

Label String

Returns

string

Translate the component

translateComponent(string $type, string $identifier = '') : string
since 7.0.0

Parameters

$type

string

The field type

$identifier

string

The identifier

Exceptions

\Exception If unknown field type

Returns

stringThe new mapping

Translate the data source mapping

translateMapping(integer $datasource, string $datasource_map) : \stdClass
since 7.0.0

Parameters

$datasource

integer

The old data source (0 = none, 1 = joomla_profile, 2 = CB)

$datasource_map

string

The target field

Returns

\stdClassThe new mapping

Translate options (select, radio, checkbox)

translateOptions(array|string $options) : array | string
since 7.0.0

Parameters

$options

arraystring

The 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
since 7.0.0
 

Contains all ordering values, to make sure they are unique

$orders : array

Default

array()
since 7.0.0