\Marketing\Events
Templating
Global Functions
Website
\Components\Website\Designs \Components\Website\Media \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories
Customers
\Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups
Marketing
\Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Categories \Components\Marketing\Events\Locations \Components\Marketing\Events\Recurring \Components\Marketing\Events\Recurring\Rules \Components\Marketing\SMSMarketing
Commerce
\Components\Commerce\Carts \Components\Commerce\Carts\Current \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\RecurringSales\Items \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \Components\Settings\CustomFields \Components\Settings\Domains
Other Apps
\Components\Website\Comments \Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards
Framework
\Framework\Caching \Framework\Data\Util \Framework\DOM\CurrentContext \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\TabState \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages

Events

Use this API to create, update and delete marketing events.

Methods

Invoke via \Components\Marketing\Events::method()
Click a method name to copy it.
- ` array applyHierarchyMetadata($arrEvents) `
Add hierarchy metadata and parent-first ordering to a list of events.
Parameters:
- $arrEvents
mixed
Return
array
- ` array canContactRSVPForEvent($iEventId, $iContactId) `
Is the specified contact allowed to RSVP for the specified Event
Parameters:
- $iEventId
mixed
- $iContactId
mixed
Return
array
- ` int cancelEvent($iEventId, $arrOptions) `
Cancel an event while keeping its public page available.
Parameters:
- $iEventId
mixed
- $arrOptions
mixed
Return
int
- ` int|null createForRecurring($arrEventDetails, $arrOccurrence, $arrOptions) `
Create a generated recurring occurrence from recurring-owned event details.
Parameters:
- $arrEventDetails
mixed
- $arrOccurrence
mixed
- $arrOptions
mixed
Return
int|null
- ` int createStatusUpdateEmailDraft($iEventId, $strType, $arrOptions) `
Create a preconfigured e-mail campaign draft for a cancellation or reschedule.
Parameters:
- $iEventId
mixed
- $strType
mixed
- $arrOptions
mixed
Return
int
- ` int createStatusUpdateSMSDraft($iEventId, $strType, $arrOptions) `
Create a preconfigured SMS campaign draft for a cancellation or reschedule.
Parameters:
- $iEventId
mixed
- $strType
mixed
- $arrOptions
mixed
Return
int
- ` array customFieldsForEvent($iEventId, $bPublicOnly, $bGuest) `
The Attendee table contains all custom fields for all events, but specific events make use of different columns. Return the relevent custom fields for a particular Event.
Parameters:
- $iEventId
mixed
- $bPublicOnly
mixed
- $bGuest
mixed
Return
Rows in the configuration custom fields table.
- ` \Iterator dbGetAllIterable($arrQuery) `
Returns the raw rows dbGetAll() would return as an iterator, without building them all into an array

The dbGetAll() counterpart of getAllIterable(), for scans over every stored row of a large table (eg: the site-wide content scans in \Framework\Developer\Refactoring). Rows are as stored - JSON fields are not decoded - and are not entity-cached. Because it bypasses getAll(), components that override getAll() are iterated; search queries and components overriding dbGetAll() are refused.
Parameters:
- $arrQuery
mixed
Return
Yields Events
- ` void ensureRecurringSubEventsFromDetails($arrEventDetails, $iGeneratedEventId, $arrParentOccurrence, $arrOptions) `
Ensure generated sub-events exist from recurring-owned sub-event details.
Parameters:
- $arrEventDetails
mixed
- $iGeneratedEventId
mixed
- $arrParentOccurrence
mixed
- $arrOptions
mixed
- ` bool eventHasAvailableCapacity($iEventId) `
Returns true if the event has available capacity.
If the event is unrestricted or has no capacity set, it will return true.
Parameters:
- $iEventId
mixed
Return
bool
- ` bool eventHasStarted($arrEvent) `
Returns true if the event's start time has passed.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool eventRSVPDeadlinePassed($iEventId) `
Returns true if the RSVP deadline for the given event has passed
Parameters:
- $iEventId
mixed
Return
bool
- ` bool eventRsvpCutoffPassed($arrEvent) `
Returns true if the effective public RSVP cutoff for the event has passed.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool eventSellsProduct($arrEvent, $iProductId) `
Whether the event sells the product - as its ticket, or as a ticket bundle of its own product.
Parameters:
- $arrEvent
mixed
- $iProductId
mixed
Return
bool
- ` array fieldsGetAll($bCached) `
Returns all the columns this component supports
Parameters:
- $bCached
mixed
Return
array
- ` array|null filterByUriSuffix($strUriSuffix) `
Gets an event entity from a URI suffix (e.g. my-event)
Parameters:
- $strUriSuffix
mixed
Return
array|null
- ` string|null generateSearchDescription($arrEntity) `
Generates the SEO search description from event content
Parameters:
- $arrEntity
mixed
Return
string|null
- ` string|null generateSearchKeywords($arrEntity) `
Generates SEO keywords from event content
Parameters:
- $arrEntity
mixed
Return
string|null
- ` string|null generateUniqueUriSuffix($arrEntity) `
Generates a unique URI suffix by cycling through formats until no collision
Parameters:
- $arrEntity
mixed
Return
string|null
- ` string|null generateUriSuffix($arrEntity, $strFormat) `
Generates the page URI suffix (SEO slug URI for the event)
Parameters:
- $arrEntity
mixed
- $strFormat
mixed
Return
string|null
- ` array get($iEventId) `
Gets a record from the database
Parameters:
- $iEventId
int unsigned
A record's event_id
Return
- ` array getAll($arrQuery) `
Return a set of records from the database
Parameters:
- $arrQuery
mixed
Return
Array of Events
- ` array getAllForCategory($arrCategoryIds, $arrQuery) `
Return all the marketing_events that belong to specific categories.
Parameters:
- $arrCategoryIds
mixed
- $arrQuery
mixed
Return
Array of Events
- ` array getAllForCategoryHierarchy($arrCategoryIds, $arrQuery) `
Return all marketing events for categories, ordered as main events with their sub-events.
Parameters:
- $arrCategoryIds
mixed
- $arrQuery
mixed
Return
array
- ` array getAllForContactAttending($iContactId, $arrQuery) `
Return all the current events that a contact is attending.
Parameters:
- $iContactId
mixed
- $arrQuery
mixed
Return
Array of Events
- ` array getAllForContactUpcoming($iContactId, $arrQuery) `
Return all of the current events that a contact is attending.
Parameters:
- $iContactId
mixed
- $arrQuery
mixed
Return
Array of Events
- ` \Iterator getAllIterable($arrQuery) `
Returns the entities getAll() would return as an iterator, without building them all into an array

For result sets too large to hold as arrays (eg: every recipient of a marketing send) - only the database driver's compact buffer of the result is held, a fraction of getAll()'s memory. Runs the same SQL as getAll(), and runs it now, as getAll() would; rows are decoded as you iterate.
Search queries are not supported, rows are not entity-cached, and components that override getAll() or dbGetAll() (eg: merging in defaults) are refused rather than iterated without their extra rows.
Parameters:
- $arrQuery
mixed
Return
Yields Events
- ` array getAvailableTicketBundles($arrEvent) `
The bundles a registration can still buy, keyed by position: all of them while capacity is unrestricted, otherwise those whose places still fit.
Parameters:
- $arrEvent
mixed
Return
[position => bundle, ...]
- ` array getChildren($iEventId, $arrQuery) `
Return child events for the specified parent event.
Parameters:
- $iEventId
mixed
- $arrQuery
mixed
Return
array
- ` array getChildrenRecursive($iEventId, $arrQuery) `
Return all descendant events for the specified event.
Parameters:
- $iEventId
mixed
- $arrQuery
mixed
Return
array
- ` mixed getColumn($iEventId, $strColumn) `
Gets a single field from a record
Parameters:
- $iEventId
int unsigned
A record's event_id
- $strColumn
mixed
Return
mixed
- ` int getCount($arrFilter) `
Returns the number of records in the database (matching the filter if specified)
Parameters:
- $arrFilter
mixed
Return
int
- ` array|null getCurrentPageEvent() `
Returns the current event if the current page is an event page, or null otherwise
Return
The event entity if on an event page, null otherwise
- ` string getEventManageUrl($arrEvent, $arrAttendee, $bAbsolute, $arrExtraParams) `
Returns the public URL of the page where an attendee reviews, changes or cancels their registration. With an attendee, the contact id and RSVP reference identify them without a login (the same credential the success and calendar links use), so the URL can be emailed.
Parameters:
- $arrEvent
mixed
- $arrAttendee
mixed
- $bAbsolute
mixed
- $arrExtraParams
mixed
Return
string
- ` float|null getEventPrice($iEventId) `
If the event is associated with a product, return the price of the product.
Parameters:
- $iEventId
mixed
Return
float|null
- ` string getEventSuccessUrl($arrEvent, $arrAttendee, $bAbsolute) `
Returns the public URL for an event's success page
Parameters:
- $arrEvent
mixed
- $arrAttendee
mixed
- $bAbsolute
mixed
Return
string
- ` string getEventUrl($arrEvent) `
Returns the public URL for an event's RSVP form page
Parameters:
- $arrEvent
mixed
Return
string
- ` array|null getFromBundleProductId($iProductId) `
A current event selling the product as a ticket bundle of its own.
Parameters:
- $iProductId
mixed
Return
array|null
- ` array|null getFromPageURI($strPageURI) `
Retrieves an event from its page URI
Parameters:
- $strPageURI
mixed
Return
array|null
- ` void getFromProductId($iProductId) `
Retrieves the event corresponding to an event product
Parameters:
- $iProductId
mixed
- ` bool getHasPublicNotice($arrEvent) `
Return true when the public event page should show a lifecycle notice.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool getIsCancelled($arrEvent) `
Return true when the event has been cancelled.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool getIsRescheduled($arrEvent) `
Return true when the event has been rescheduled and is still active.
Parameters:
- $arrEvent
mixed
Return
bool
- ` array|null getParent($arrEvent) `
Return the direct parent for an event.
Parameters:
- $arrEvent
mixed
Return
array|null
- ` string getPublicNoticeMessage($arrEvent) `
Return the current public notice message.
Parameters:
- $arrEvent
mixed
Return
string
- ` string getPublicNoticeTitle($arrEvent) `
Return the title for the current public notice.
Parameters:
- $arrEvent
mixed
Return
string
- ` string getPublicUrlPath() `
Returns the public URL path for events (e.g. /events-rsvp/)
Return
string
- ` int|null getRemainingPlaces($arrEvent) `
Places left before a capacity-restricted event is full.
Parameters:
- $arrEvent
mixed
Return
Null when capacity is not restricted
- ` array|null getRootEvent($arrEvent) `
Return the top-level event for an event.
Parameters:
- $arrEvent
mixed
Return
array|null
- ` int|false getRsvpCutoffTimestamp($arrEvent) `
Return the effective public RSVP cutoff timestamp for an event.

An explicit RSVP deadline always wins. Without one, registrations close when the event starts - except for an event with sub-events, where they stay open until the last non-cancelled sub-event starts (later sub-events remain individually registrable after the parent has begun).
Parameters:
- $arrEvent
mixed
Return
Unix timestamp, or false when no usable date exists
- ` array getStatusUpdateAudienceOptions() `
Return attendee audience options for event status-update campaigns.
Return
array
- ` string getSubEventRegistrationModeTitle($arrEvent) `
Return the display title for a sub-event registration mode.
Parameters:
- $arrEvent
mixed
Return
string
- ` array getSubEventRegistrationModes() `
Return available registration behaviours for sub-events.
Return
array
- ` string getSubEventRegistrationSummary($arrEvent) `
Return a short admin summary of how a sub-event participates in registration.
Parameters:
- $arrEvent
mixed
Return
string
- ` array getSubEventsForRegistration($arrEvent, $arrQuery) `
Return sub-events shown on the public registration form for a main event.
Parameters:
- $arrEvent
mixed
- $arrQuery
mixed
Return
array
- ` array|null getTicketBundle($arrEvent, $iPosition) `
A bundle by its position on the RSVP form: 1 is the first bundle, 0 an individual ticket.
Parameters:
- $arrEvent
mixed
- $iPosition
mixed
Return
['title' => string, 'seats' => int, 'price' => float]
- ` array getTicketBundles($arrEvent) `
The ticket bundles a paid event sells - a named number of places at one price ("Couple", "Group of 3", "Table of 10") - from event_ticket_bundles.
Parameters:
- $arrEvent
mixed
Return
[['title' => string, 'seats' => int, 'price' => float], ...] in the order offered; empty when the event sells no bundles
- ` array getUriFormats() `
Returns the available URL format patterns for event URI generation
Return
Array of format strings
- ` array|null getUriSuffixCollision($arrEntity) `
Gets the event that has a colliding URI suffix, or null if available
Parameters:
- $arrEntity
mixed
Return
The colliding event, or null if suffix is available
- ` bool delete($iEventId, $bDeleteMedia) `
Deletes a record from the database
Parameters:
- $iEventId
int unsigned
A record's event_id
- $bDeleteMedia
mixed
Return
Returns true if record existed and was deleted, otherwise false
- ` string|null getPublicNoticeType($arrEvent) `
Return the current public notice type.
Parameters:
- $arrEvent
mixed
Return
string|null
- ` bool isContactAllowedInEvent($iEventId, $iContactId) `
Is the specified contact allowed to be added to the specified Event
Parameters:
- $iEventId
mixed
- $iContactId
mixed
Return
Return true if allowed, false if not.
- ` bool isContactAttending($iEventId, $iContactId, $bIncludeMaybe) `
Return true if the specified contact is registered to attend the specified event.
Parameters:
- $iEventId
mixed
- $iContactId
mixed
- $bIncludeMaybe
mixed
Return
bool
- ` bool isContactCompanyAllowedInEvent($iEventId, $iContactId) `
Is the specified contact allowed to be added to the specified Event
Parameters:
- $iEventId
mixed
- $iContactId
mixed
Return
Return true if allowed, false if not.
- ` array normaliseTicketBundles($mBundles) `
Cleans a ticket bundles value: a bundle needs at least two places and a non-negative price, an unnamed one is called "Group of N", and it may name a product of its own to be sold as. Ordered by places then price - a bundle's position in this list is its key on the RSVP form (see getTicketBundle()), so two bundles may share a size at different prices.
Parameters:
- $mBundles
mixed
Return
[['title' => string, 'seats' => int, 'price' => float, 'product_id' => int|null], ...]
- ` string renderEventDate($arrEvent, $bIncludeTZ) `
Return the event date with the format: (On the same day) 1 Sep 2016 2:00pm - 4:00pm. (Different day) 1 Sep 2016 2:00pm - 3 Sep 2016 3:00pm.
Parameters:
- $arrEvent
mixed
- $bIncludeTZ
mixed
Return
string
- ` string renderEventPrice($iEventId) `
Render the price of an event, if it has one.
Parameters:
- $iEventId
mixed
Return
string
- ` string renderTicketBundleLabel($arrBundle) `
"Couple (2 tickets)"
Parameters:
- $arrBundle
mixed
Return
string
- ` string renderTime($arrEvent, $iTime, $strDateFormat, $strTimeFormat) `
Return $iTime formatted into a human-readable string, in the timezone specified for this event.
Parameters:
- $arrEvent
mixed
- $iTime
mixed
- $strDateFormat
mixed
- $strTimeFormat
mixed
Return
string
- ` int rescheduleEvent($iEventId, $arrOptions) `
Reschedule an event and record its previous date for public messaging and calendar updates.
Parameters:
- $iEventId
mixed
- $arrOptions
mixed
Return
int
- ` string|int save($arrEntity) `
Saves a record into the database
Parameters:
- $arrEntity
mixed
Return
string|int
- ` void saveColumn($iEventId, $strColumn, $strValue) `
Saves a specific column of a row into a database
Parameters:
- $iEventId
int unsigned
A record's event_id
- $strColumn
mixed
- $strValue
mixed
- ` int saveForRecurringGeneration($arrEntity) `
Save an event without detaching it from its recurring series.
Parameters:
- $arrEntity
mixed
Return
int
- ` array search($strSearch, $arrQuery) `
Performs a search
Parameters:
- $strSearch
mixed
- $arrQuery
mixed
Return
Array of Events that match the search query.
- ` bool subEventAddsProductToParentRsvp($arrEvent) `
Return whether selecting this sub-event should add its linked product to the cart.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool subEventDirectRsvpIsEnabled($arrEvent) `
Return whether a direct RSVP URL is allowed for a sub-event.
Parameters:
- $arrEvent
mixed
Return
bool
- ` bool subEventIsRegistrationOptional($arrEvent) `
Return whether attendees can choose this sub-event on its parent's RSVP page.
Parameters:
- $arrEvent
mixed
Return
bool
- ` void syncGeneratedRecurringEventFromDetails($arrEventDetails, $iGeneratedEventId, $arrOccurrence, $arrOptions) `
Keep an attached generated occurrence aligned with embedded recurring details.
Parameters:
- $arrEventDetails
mixed
- $iGeneratedEventId
mixed
- $arrOccurrence
mixed
- $arrOptions
mixed
- ` boolean uriSuffixIsAvailable($arrEntity) `
Determines if a URI suffix for a given entity is available
Parameters:
- $arrEntity
mixed
Return
boolean
- ` array withSubEventRegistrationDefaults($arrEvent) `
Return an event-shaped array with the new sub-event RSVP flags populated.
Parameters:
- $arrEvent
mixed
Return
array

Database Fields

The following fields are used when retrieving and saving entities:
- `event_id`
int unsigned (10)
- `event_parent_id`
int unsigned (10)
- `event_sub_event_registration_mode`
string (32)
Default value: optional
- `event_sub_event_registration_optional`
0 or 1
Default value: 1
- `event_sub_event_direct_rsvp_enabled`
0 or 1
- `event_recurring_series_id`
int unsigned (10)
- `event_recurring_rule_id`
int unsigned (10)
- `event_recurring_occurrence_date`
date
- `event_recurring_generation_key`
string (128)
- `event_recurring_is_detached`
0 or 1
- `event_title`
string (255)
- `event_start_datetime`
datetime
- `event_end_datetime`
datetime
- `event_timezone`
string (255)
- `event_capacity`
int (10)
- `event_rsvp_deadline_datetime`
datetime
- `event_capacity_restrictive`
0 or 1
- `event_attendance_via_qrcode`
0 or 1
- `event_location_id`
int (10)
- `event_description`
string (16777215)
- `event_custom_fields`
string (16777215)
- `event_allow_alternate_rsvp`
0 or 1
- `event_allow_guest_rsvp`
0 or 1
- `event_attendee_company_rsvp`
0 or 1
- `event_linked_product`
int (10)
- `event_enable_product_order_options`
0 or 1
- `event_linked_guest_product`
int (10)
- `event_ticket_bundles`
string (65535)
- `event_attending_count`
int unsigned (10)
- `event_attending_checkedin_count`
int unsigned (10)
- `event_notattending_count`
int unsigned (10)
- `event_maybe_count`
int unsigned (10)
- `event_norsvp_count`
int unsigned (10)
- `event_allow_maybe_rsvp`
0 or 1
Default value: 1
- `event_requires_invitation`
tinyint (4)
Default value: 1
- `event_require_phone`
0 or 1
Default value: 1
- `event_guests_price`
decimal unsigned (10,4)
- `event_guests_custom_fields`
string (16777215)
- `event_uri_suffix`
string (255)
- `event_uri_suffix_is_overridden`
0 or 1
- `event_search_title`
string (255)
- `event_search_title_is_overridden`
0 or 1
- `event_search_description`
string (255)
- `event_search_description_is_overridden`
0 or 1
- `event_search_keywords`
string (255)
- `event_search_keywords_is_overridden`
0 or 1
- `event_search_noindex`
0 or 1
- `event_search_nofollow`
0 or 1
- `event_created_datetime`
datetime
- `event_modified_datetime`
datetime
- `event_require_address`
0 or 1
- `event_require_dob`
0 or 1
- `event_guests_require_registration`
0 or 1
Default value: 1
- `event_guests_require_email`
int (1)
- `event_guests_require_phone`
int (1)
- `event_guests_require_dob`
0 or 1
- `event_icon`
string (255)
- `event_is_offline`
0 or 1
- `event_cancelled_datetime`
datetime
- `event_cancelled_message`
string (65535)
- `event_rescheduled_datetime`
datetime
- `event_previous_start_datetime`
datetime
- `event_previous_end_datetime`
datetime
- `event_rescheduled_message`
string (65535)
- `event_calendar_sequence`
int unsigned (10)
- `event_external_rsvp_url`
string (255)
- `event_rsvp_disabled`
0 or 1
- `event_description_short`
string (16777215)