Broarm\EventTickets\Discount
Class Discount
Synopsis
class Discount
extends PriceModifier
{
- // constants
- const PRICE = 'PRICE';
- const PERCENTAGE = 'PERCENTAGE';
- const APPLIES_EACH_TICKET = 'EACH_TICKET';
- // members
- private static string $singular_name = 'Discount';
- private static array $db = ;
- private static string $default_sort = "ValidFrom DESC";
- private static array $many_many = ;
- private static array $indexes = ;
- private static array $summary_fields = ;
- private static array $defaults = ;
- // methods
- public FieldList getCMSFields()
- public void onBeforeWrite()
- public string getTableTitle()
- public bool validateUses()
- public void updateTotal()
- public bool validateDate()
- public bool validateGroups()
- public bool validateEvents()
- public string generateCode()
Hierarchy
Extends
- Broarm\EventTickets\PriceModifier
Constants
Name | Value |
---|---|
PRICE | 'PRICE' |
PERCENTAGE | 'PERCENTAGE' |
APPLIES_EACH_TICKET | 'EACH_TICKET' |
Members
private
- $db
- $default_sort
- $defaults
- $indexes
- $many_many
- $singular_name
- $summary_fields
Methods
public
- generateCode() — Generate a unique coupon code
- getCMSFields() — Create the needed cms fields
- getTableTitle() — Return the table title
- onBeforeWrite()
- updateTotal() — Calculate the discount
- validateDate() — Check if the from and till dates are in the past and future
- validateEvents() — Validate if the given event is in the group of allowed events
- validateGroups() — Validate the given member with the allowed groups
- validateUses() — Check if the discount exceeded the maximum uses