BasketItem

Extends \NextEvent\PHPSDK\Model\Model

BasketItem model

Model class representing a single item (ticket) of a NextEvent basket

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

Register the given BasketItem as a child element

addChildItem(\NextEvent\PHPSDK\Model\BasketItem $item) 

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 associated category model

getCategory() : \NextEvent\PHPSDK\Model\Category

Getter for child items

getChildren() : array

Child items represent additional basket items like ticket options, side events, etc. which are coupled with the given basket item and cannot be booked individually.

They also contribute to the overall price and may or may not be listed in a basket summary.

Response

array

List of nested BasketItems

Get a description for this order item

getDescription(string $delimiter = ' - ') : string

The description is composed from the associated category and price titles

Arguments

$delimiter

string

Character(s) used to separate description segments

Response

string

Get the model for discount information

getDiscountCode() : \NextEvent\PHPSDK\Model\DiscountCode|null

Get the event identifier this item refers to

getEventId() : string

Response

string

eventId

Get the title of the event this item refers to

getEventTitle() : string

Response

string

Get the unique identifier of this item

getId() : integer

Response

integer

Get the order/basket identifier this item is associated with

getOrderId() : integer

Response

integer

orderId

Get the model for price information

getPrice() : \NextEvent\PHPSDK\Model\Price

Getter for seat information

getSeat() : \NextEvent\PHPSDK\Model\Seat|null

Get the type of the basket/order item

getType() : string

Response

string

Either 'ticket' or 'addition'

Determine whether this basket item has seat information assigned

hasSeat() : boolean

Response

boolean

True if this is a seated ticket and seat information is available

Getter for the deleted flag

isDeleted() : boolean

Rebookig items have the deleted flag set if they are subject to be cancelled from the order.

Response

boolean

True if this item has been flagged for deletion

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