Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class CouponTerms

Coupon term management

Model
Extended by AppModel uses Blesta\Core\Util\Common\Traits\Container
Extended by CouponTerms
Package: blesta\app\models
Copyright: Copyright (c) 2017, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/coupon_terms.php
Methods summary
public
# __construct( )

Initialize Coupons

Initialize Coupons

Overrides

AppModel::__construct()
public integer
# add( array $vars )

Creates a new coupon term

Creates a new coupon term

Parameters

$vars

An array of coupon term information including:

  • coupon_id The coupon ID this coupon term belongs to
  • term The number of periods for this coupon term
  • period The period for this coupon term

Returns

integer
The ID for this coupon term
public
# edit( integer $term_id, array $vars )

Edits a coupon term

Edits a coupon term

Parameters

$term_id
The ID of the coupon term to update
$vars

An array of coupon term information including:

  • coupon_id The coupon ID this coupon term belongs to
  • term The number of periods for this coupon term
  • period The period for this coupon term
public
# delete( integer $coupon_id, integer $term_id = null )

Permanently removes the coupon term from the system

Permanently removes the coupon term from the system

Parameters

$coupon_id
The ID of the coupon to delete terms for
$term_id
The ID of the coupon term to delete (optional)
public The
# get( integer $term_id, array $criteria = [] )

Gets the specified coupon term if it meets the given criteria

Gets the specified coupon term if it meets the given criteria

Parameters

$term_id
The ID of the coupon term to fetch
$criteria

A list of criteria to filter by, including:

  • coupon_id The coupon ID this coupon term belongs to
  • term The number of periods for this coupon term
  • period The period for this coupon term

Returns

The
given coupon term, false on failure
public
# getAll( array $criteria = [] )

Gets all coupon terms that meet the given criteria

Gets all coupon terms that meet the given criteria

Parameters

$criteria

A list of criteria to filter by, including:

  • coupon_id The coupon ID this coupon term belongs to
  • term The number of periods for this coupon term
  • period The period for this coupon term
public array
# getPeriods( )

Gets a list of valid periods for coupon terms

Gets a list of valid periods for coupon terms

Returns

array
A list of valid periods and their language
Methods inherited from AppModel
_(), boolToInt(), currencyToDecimal(), dateToUtc(), errors(), getPerPage(), ifSet(), loadCrypto(), setDefaultIfEmpty(), setPerPage(), setRulesIfSet(), strToBool(), systemDecrypt(), systemEncrypt(), systemHash(), truncateDecimal(), validateExists(), validateStateCountry()
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen