Basket

Extends \NextEvent\PHPSDK\Model\Model

Basket model

Represents a basket model retrieved from the API

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

Getter for items assigned to this basket

getBasketItems() : array<mixed,\NextEvent\PHPSDK\Model\BasketItem>

Response

array<mixed,\NextEvent\PHPSDK\Model\BasketItem>

Getter for the cancellation total of a rebooking order

getCancellationTotal() : float

This represents the total amount paid for the previous order this basket is supposed to replace.

Response

float

Getter for the basket's expiration date

getExpires() : \NextEvent\PHPSDK\Model\DateTime|null

Can be null if the basket has no specific expiration date

Response

\NextEvent\PHPSDK\Model\DateTime|null

Getter for the basket identifier

getId() : integer

Response

integer

basketId

Getter for rebooking order reference

getReplacedOrderId() : integer

Response

integer

The ID of the order to be replaced by this basket

Getter for the unique hash that can be passed to widgets to assign this basket to a users booking session.

getWidgetParameter() : string|null

Response

string|null

Group the list of given BasketItem by their parent_ticket_id references

groupItems(array $items) : array
static

Arguments

$items

array

Response

array

Determine whether the basket has items assigned

hasBasketItems() : boolean

Use this method to check whether the basket is empty or not.

Response

boolean

True if basket contains at least one item

Indicates whether this basket is a rebooking basket

isRebookOrder() : boolean

Rebooking baskets will replace the linked order once completed. Use Basket::getReplacedOrderId() to get the ID of the previous order this basket will replace.

Response

boolean

True if this is a rebooking basket, false otherwise

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