Templating
Global Functions
Website
\Components\Website\Designs \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\Locations
Commerce
\Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \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\FileBased \Framework\Data\Util \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\GeoIP
Methods

\Components\Marketing\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 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
int
The event to get custom fields for.
$bPublicOnly
bool
Whether to only return public custom fields. Defaults to false.
$bGuest
bool
Guest registration fields
Return
Rows in the configuration custom fields table.
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
array|null
Return
Array of Events
array getAllForContactAttending($iContactId, $arrQuery)
Return all of the current events that a contact is attending.
Parameters
$iContactId
int
$arrQuery
array|null
Return
Array of Events
array getAllForContactUpcoming($iContactId, $arrQuery)
Return all of the current events that a contact is attending.
Parameters
$iContactId
int
$arrQuery
array|null
Return
Array of Events
mixed getColumn($iEventId, $strColumn)
Gets a single field from a record
Parameters
$iEventId
int unsigned
A record's event_id
$strColumn
string
Return
mixed
int getCount($arrFilter)
Returns the number of records in the database (matching the filter if specified)
Parameters
$arrFilter
array|null
Return
int
void getFromProductId($iProductId)
Retrieves the event corresponding to an event product
Parameters
$iProductId
int
bool isContactAllowedInEvent($iEventId, $iContactId)
Is the specified contact allowed to be added to the specified Event
Parameters
$iEventId
int
$iContactId
int
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
int
$iContactId
int
$bIncludeMaybe
bool
If true, then return true if the contact has RSVP'd with the 'maybe' status.
Return
bool
bool isContactCompanyAllowedInEvent($iEventId, $iContactId)
Is the specified contact allowed to be added to the specified Event
Parameters
$iEventId
int
$iContactId
int
Return
Return true if allowed, false if not.
string renderEventDate($arrEvent)
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
array
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
array
The event that has the timezone.
$iTime
int
The time offset to render.
$strDateFormat
string|null
Optionally specify a custom date format.
$strTimeFormat
string|null
Optionally specify a custom time format.
Return
string
int unsigned save($arrEntity)
Saves a record into the database
Parameters
$arrEntity
array
Return
The record's event_id
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
string
$strValue
string
array search($strSearch, $arrQuery)
Performs a search
Parameters
$strSearch
string
Search query
$arrQuery
array|null
Return
Array of Events that match the search query.
bool delete($iEventId, $bDeleteMedia)
Deletes a record from the database
Parameters
$iEventId
int unsigned
A record's event_id
$bDeleteMedia
bool
Return
Returns true if record existed and was deleted, otherwise false

Database Fields

The following fields are used when retrieving and saving entities.
event_id
int unsigned (10)
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_location_id
int (10)
event_description
string (65535)
event_custom_fields
string (65535)
event_allow_alternate_rsvp
0 or 1
event_allow_guest_rsvp
0 or 1
event_linked_product
int (10)
event_linked_guest_product
int (10)
event_attending_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_custom_fields
string (65535)
event_require_address
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)