Event

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

Event model

Model class for an event record registered in NextEvent. Provides simplified access to event title, details, start/end dates, etc.

see
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 changed date of this event

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

Get the creation data of this event

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

Get a description text for the event

getDescription() : string

Response

string

Get the end date of this event

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

Getter for the unique event identifier

getId() : string

Response

string

Get the title image of the event

getImage() : string|null

Response

string|null

The image url as string (if set)

Get the location this event takes place

getLocation() : \NextEvent\PHPSDK\Model\Location|null

Get the organizer info for this event

getOrganizer() : \NextEvent\PHPSDK\Model\Organization|null

Get the start date of this event

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

Get the state of this event

getState() : string

Tells whether the event is active for sale or in another pre or post sale state.

Possible values are: draft, active, closed. Note, that booking in draft and closed is only possible for admin of the event. In addition the order process can only be completed if the basket has only tickets for active events.

Response

string

Get the event title

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

Mutates the description of this event.

setDescription(string $description) : \NextEvent\PHPSDK\Model\Event

Arguments

$description

string

Response

\NextEvent\PHPSDK\Model\Event

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 event.

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

Arguments

$title

string

Response

\NextEvent\PHPSDK\Model\Event

Creates a new event instance with the given data.

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

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

Arguments

$data

array

Response

\NextEvent\PHPSDK\Model\Event

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