Broarm\EventTickets\Model\Ticket
Class Ticket
Synopsis
class Ticket
extends DataObject
{
- // members
- private static string $table_name = 'EventTickets_Ticket';
- private static string $sale_start_threshold = '-1 week';
- private static string $sale_end_threshold = '-12 hours';
- private static array $db = ;
- private static string $default_sort = 'Sort ASC, AvailableFromDate DESC';
- private static array $has_one = ;
- private static array $defaults = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $translate = ;
- // methods
- public void getCMSFields()
- public string singular_name()
- public DBDate|DBField|null getAvailableFrom()
- public DBDatetime|DBField|null getAvailableTill()
- public bool validateDate()
- private bool validateAvailability()
- public bool getAvailable()
- public LiteralField getAvailableSummary()
- private DBDatetime|null getEventStartDate()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $db
- $default_sort
- $defaults
- $has_one
- $sale_end_threshold
—
string
The default sale end date This defaults to the event start date time '-12 hours' - $sale_start_threshold
—
string
The default sale start date This defaults to the event start date '-1 week' - $searchable_fields
- $summary_fields
- $table_name
- $translate
Methods
private
- getEventStartDate() — Get the event start date
- validateAvailability() — Validate the available capacity
public
- getAvailable() — Return if the ticket is available or not
- getAvailableFrom() — Get the available form date if it is set, otherwise get it from the parent
- getAvailableSummary() — Return availability for use in grid fields
- getAvailableTill() — Get the available till date if it is set, otherwise get it from the parent Use the event start date as last sale possibility
- getCMSFields()
- singular_name() — Returns the singular name without the namespaces
- validateDate() — Validate if the start and end date are in the past and the future