Broarm\EventTickets\Model\Reservation
Class Reservation
Synopsis
class Reservation
extends DataObject
{
- // constants
- const STATUS_CART = 'CART';
- const STATUS_PENDING = 'PENDING';
- const STATUS_PAID = 'PAID';
- const STATUS_CANCELED = 'CANCELED';
- // members
- private static string $table_name = 'EventTickets_Reservation';
- private static string $delete_after = '+1 hour';
- private static $mail_sender;
- private static $mail_receiver;
- private static bool $send_receipt_mail = true;
- private static bool $send_admin_notification = true;
- private static array $db = ;
- private static string $default_sort = 'Created DESC';
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $extensions = ;
- private static array $belongs_many_many = ;
- private static array $indexes = ;
- private static array $summary_fields = ;
- // methods
- public void getCMSFields()
- public void onBeforeWrite()
- public void onBeforeDelete()
- public string singular_name()
- public string getGatewayNice()
- public bool isDiscarded()
- public string getName()
- public string getState()
- private array getStates()
- public float calculateTotal()
- public boolean changeState()
- public void complete()
- public void setMainContact()
- public string createReservationCode()
- public Mpdf createTicketFile()
- public bool sendReservation()
- public bool sendNotification()
- public void send()
- public void canView()
- public void canEdit()
- public void canDelete()
- public void canCreate()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Constants
Name | Value |
---|---|
STATUS_CART | 'CART' |
STATUS_PENDING | 'PENDING' |
STATUS_PAID | 'PAID' |
STATUS_CANCELED | 'CANCELED' |
Members
private
- $belongs_many_many
- $db
- $default_sort
- $delete_after
—
string
Time to wait before deleting the discarded cart Give a string that is parsable by strtotime - $extensions
- $has_many
- $has_one
- $indexes
- $mail_receiver
—
string
The address from where the ticket mails are sent By default the admin email is used - $mail_sender
—
string
The address to whom the ticket notifications are sent By default the admin email is used - $send_admin_notification
—
Broarm\EventTickets\Model\bool
Send the admin notification - $send_receipt_mail
—
Broarm\EventTickets\Model\bool
Send the receipt mail For organisations that only do free events you can configure this to hold back the receipt and only send the tickets - $summary_fields
- $table_name
Methods
private
- getStates() — Get a the translated map of available states
public
- calculateTotal() — Get the total by querying the sum of attendee ticket prices
- canCreate()
- canDelete()
- canEdit()
- canView()
- changeState() — Safely change to a state todo check if state direction matches
- complete() — Complete the reservation
- createReservationCode() — Create a reservation code
- createTicketFile() — Creates a printable ticket for the attendee
- getCMSFields()
- getGatewayNice() — Returns the nice gateway title
- getName() — Get the full name
- getState() — Return the translated state
- isDiscarded() — Check if the cart is still in cart state and the delete_after time period has been exceeded
- onBeforeDelete() — After deleting a reservation, delete the attendees and files
- onBeforeWrite() — Generate a reservation code if it does not yet exists
- send() — Send the reservation and notification
- sendNotification() — Send a booking notification to the ticket mail sender or the site admin
- sendReservation() — Send the reservation mail
- setMainContact() — Set the main contact id
- singular_name() — Gets a nice unnamespaced name