DiscountGroup

Extends \NextEvent\PHPSDK\Model\Model

Discount group model

Struct for a discount group registered in the system.

package

NextEvent\PHPSDK\Model

Methods

Supports getX or hasX Methods for properties which are yet unknown.

__call(string $name, array $args) : mixed
inherited

If the source of your model contains, e.g. a property named 'my_property', you can call getMyProperty() to retrieve it's value.

Arguments

$name

string

$args

array

Response

mixed

Model constructor

__construct(array $source) 
inherited

Parse source data.

Throws
\NextEvent\PHPSDK\Exception\InvalidModelDataException

Arguments

$source

array

The source data as received from the API

Get the value for the given variable.

get(string $var) : mixed
inherited

Should be used, if you expect the model to have custom properties which are not known/covered by the known getters

Arguments

$var

string

Response

mixed

Get the absolute discount amount

getAmount() : float

Response

float

or null if a realtive factor is set

Get the description text of this discount group

getDescription() : string

Response

string

Get the display name of this discount group

getDisplayname() : string

This is basically an alias for self::getTitle()

Response

string

Get the relative discount factor (i.e. the percentage)

getFactor() : float

Response

float

or null if an absolute amount is set

Get the unique identifier for this discount group

getId() : integer

Response

integer

Get the title/name of this discount group

getTitle() : string

Response

string

Check model state if it is valid

isValid() : boolean
inherited abstract

Response

boolean

String representation of object

serialize() : string
inherited

Implements Serializable interface

Response

string

Convert model to an Array

toArray() : array
inherited

Response

array

Convert the model for logging

toLogContext() : array
inherited

Implements the LogContextInterface interface

Response

array

Represent the model as string

toString() : string
inherited

Response

string

Constructs the object from a string

unserialize( $serialized) 
inherited

Implements Serializable interface

Arguments

$serialized