Sunnysideup\EcommerceDiscountCoupon\Model\DiscountCouponOption
- Author: nicolaas [at] sunnysideup.co.nz
Synopsis
class DiscountCouponOption
extends DataObject
{
- // members
- protected bool $isNew = false;
- protected boolean $_productsCalculated = false;
- private static string $table_name = 'DiscountCouponOption';
- private static array $db = ;
- private static array $many_many = ;
- private static array $indexes = ;
- private static array $casting = ;
- private static array $searchable_fields = ;
- private static array $field_labels = ;
- private static array $field_labels_right = ;
- private static array $summary_fields = ;
- private static array $defaults = ;
- private static string $singular_name = 'Discount Coupon';
- private static string $plural_name = 'Discount Coupons';
- private static array $default_sort = ;
- // methods
- public void scaffoldSearchFields()
- public void i18n_singular_name()
- public void i18n_plural_name()
- public void populateDefaults()
- public void UseCount()
- public void getUseCount()
- public bool IsValid()
- public void getIsValid()
- public string IsValidNice()
- public void getIsValidNice()
- public bool canCreate()
- public bool canView()
- public bool canEdit()
- public bool canDelete()
- public void getCMSFields()
- public void validate()
- protected void onBeforeWrite()
- protected void onAfterWrite()
- protected void onBeforeDelete()
- protected void thereAreCouponsWithTheSameCode()
- protected void createRandomCode()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
-
$casting
standard SS variable. - $db
-
$default_sort
standard SS variable. -
$defaults
standard SS variable. -
$field_labels
standard SS variable. -
$field_labels_right
standard SS variable. -
$indexes
standard SS variable. - $many_many
-
$plural_name
standard SS variable. -
$searchable_fields
standard SS variable. -
$singular_name
standard SS variable. -
$summary_fields
standard SS variable. - $table_name
—
string
standard SS Variable.
protected
- $_productsCalculated
- $isNew — Sunnysideup\EcommerceDiscountCoupon\Model\bool
Methods
protected
- createRandomCode() — returns a random string.
- onAfterWrite() — standard SS method.
- onBeforeDelete()
- onBeforeWrite() — standard SS method.
- thereAreCouponsWithTheSameCode() — Checks if there are coupons with the same code as the current one.
public
- IsValid() — casted variable telling us if the discount coupon is valid.
- IsValidNice() — casted variable telling us if the discount coupon is valid - formatted nicely...
- UseCount() — casted variable returns the number of times this coupon has been used.
- canCreate() — standard SS method.
- canDelete() — standard SS method.
- canEdit() — standard SS method.
- canView() — standard SS method.
- getCMSFields() — standard SS method.
- getIsValid()
- getIsValidNice()
- getUseCount()
- i18n_plural_name()
- i18n_singular_name()
- populateDefaults() — standard SS method.
- scaffoldSearchFields()
- validate() — standard SS method THIS ONLY WORKS FOR CREATED OBJECTS.