BaseCategory

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

BaseCategory model

Provides the structure for a base category record.

Base categories are categories which can not be booked and are never linked to an order item. Base categories are internally used to create category records. All values which are set for a base category will automatically be applied to the related category records.

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

Returns a list of base prices for this base category.

getBasePrices() : \NextEvent\PHPSDK\Model\Collection

Get the capacity of this base category.

getCapacity() : integer|null

This value could be useless if individual capacities have been set for single categories.

Response

integer|null

Get the changed date of this base category

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

Get the creation data of this base category

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

Get the display name of this category

getDisplayname() : string|null

Use this in listing, checkout summary or invoices

Response

string|null

Get the event identifier this category belongs to

getEventId() : string

Response

string

Get the unique identifier for this base category.

getId() : integer

Response

integer

Get the title/name of this base category.

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

Sets the base prices for this base category.

setBasePrices(\NextEvent\PHPSDK\Model\Collection $basePrices) : void

Arguments

Set the rest client for this base category, base prices may be fetched for it.

setRestClient(\NextEvent\PHPSDK\Rest\Client $restClient) : \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

Set the title/name of this base category.

setTitle( $title) : \NextEvent\PHPSDK\Model\BaseCategory

Arguments

$title

Response

\NextEvent\PHPSDK\Model\BaseCategory

Creates a new base category instance with the given data.

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

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

The created category will also get an empty base price collection assigned. This way, you to not have to do it yourself and can just push your prices into the collection.

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

Arguments

$data

array

Response

\NextEvent\PHPSDK\Model\BaseCategory

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