BasePrice

Extends \NextEvent\PHPSDK\Model\MutableModel Implements \NextEvent\PHPSDK\Model\Spawnable

BasePrice model

Provides the structure for a base price record.

A base price is a price which applies it's data to actual price records. A base price is never linked to a category record. It rather links to a BaseCategory. Just like a base category, a base price is never linked to an order item.

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 base category model instance for this price, if any set

getBaseCategory() : \NextEvent\PHPSDK\Model\BaseCategory|null

Get the base category id for this base price.

getBaseCategoryId() : integer

Response

integer

Get the changed date of this base price

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

Get the creation data of this base price

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

Get the currency of this bae price.

getCurrency() : string

Response

string

Alphanumeric currency code according to ISO 4217.

Get the unique identifier of this base price record.

getId() : integer

Response

integer

Get the price of this base price.

getPrice() : float

Response

float

Get the title for this price

getTitle() : string

Response

string

Determines whether this spawnable is new or not.

isNew() : boolean
inheritdoc

Response

boolean

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

Set the base category model instance for this price.

setBaseCategory(\NextEvent\PHPSDK\Model\BaseCategory $baseCategory) : void

The base_category_id and the event_id will be applied to the data of this base price if it is a new one.

Throws
\NextEvent\PHPSDK\Exception\InvalidArgumentException

If the given argument is not a base category.

\NextEvent\PHPSDK\Exception\InvalidBaseCategoryException

If the id of the given base category does not match the one of this instance.

Arguments

Mutate the currency of this bae price.

setCurrency(string $currency) : \NextEvent\PHPSDK\Model\BasePrice

Arguments

$currency

string

The currency to set.

Response

\NextEvent\PHPSDK\Model\BasePrice

Mutates the price of this base price.

setPrice(float $price) : \NextEvent\PHPSDK\Model\BasePrice

Arguments

$price

float

The price to set.

Response

\NextEvent\PHPSDK\Model\BasePrice

Sets the source of this model instance.

setSource(array $source) : \NextEvent\PHPSDK\Model\MutableModel
inherited
access

private

Arguments

$source

array

The source data as received from the API.

Response

\NextEvent\PHPSDK\Model\MutableModel

Mutates the title of this base price.

setTitle(string $title) : \NextEvent\PHPSDK\Model\BasePrice

Arguments

$title

string

The title to set.

Response

\NextEvent\PHPSDK\Model\BasePrice

Creates a new base price instance with the given data.

spawn(array $data, \NextEvent\PHPSDK\Model\BaseCategory $baseCategory) : \NextEvent\PHPSDK\Model\BasePrice
static

The resulting instance will be marked as a new base price which has not been persisted via API.

Use this method if you want to create a new base price and persist it via the client.

Arguments

$data

array

$baseCategory

\NextEvent\PHPSDK\Model\BaseCategory

The base category reference.

Response

\NextEvent\PHPSDK\Model\BasePrice

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