Access code model
An access code is used in the entrance check process.
Each access code owns a (bar)code, a category id and a state.
A Gate is responsible for invalidating,
i.e. modifying the entry_state, of such an access code.
| package |
NextEvent\PHPSDK\Model |
|---|
__call(string $name, array $args) : mixed
If the source of your model contains, e.g. a property named 'my_property',
you can call getMyProperty() to retrieve it's value.
string
array
mixed
__construct(array $source)
Parse source data.
| Throws |
|
|---|
arrayThe source data as received from the API
get(string $var) : mixed
Should be used, if you expect the model to have custom properties which are not known/covered by the known getters
string
mixed
getAccessFrom() : \NextEvent\PHPSDK\Model\DateTime|null
getAccessTo() : \NextEvent\PHPSDK\Model\DateTime|null
getCategoryId() : integer
integer
getChangedDate() : \NextEvent\PHPSDK\Model\DateTime|null
getCode() : string
string
getCreatedDate() : \NextEvent\PHPSDK\Model\DateTime|null
getDeviceId() : integer
integer
getEntries() : integer|null
integer|null
getEntryState() : integer
| see |
\NextEvent\PHPSDK\Model\AccessCode::ENTRY_IN
For the in state \NextEvent\PHPSDK\Model\AccessCode::ENTRY_OUTFor the out state \NextEvent\PHPSDK\Model\AccessCode::ENTRY_NONEFor no entry state |
|---|---|
integer
getGateId() : integer|null
integer|null
getId() : integer
integer
getLastGate() : string|null
string|null
getLastStateChange() : \NextEvent\PHPSDK\Model\DateTime|null
getPriceId() : integer|null
integer|null
getProcessed() : \NextEvent\PHPSDK\Model\DateTime|null
getState() : integer
| see |
\NextEvent\PHPSDK\Model\AccessCode::STATE_VALID
For the valid state \NextEvent\PHPSDK\Model\AccessCode::STATE_CANCELLEDFor the cancelled state \NextEvent\PHPSDK\Model\AccessCode::STATE_EXTERNALFor the external state |
|---|---|
integer
isNew() : boolean
| inheritdoc | |
|---|---|
boolean
isValid() : boolean
boolean
serialize() : string
Implements Serializable interface
string
setAccessFrom(\NextEvent\PHPSDK\Model\DateTime|string|null $date) : \NextEvent\PHPSDK\Model\AccessCode
| Throws |
|
|---|
\NextEvent\PHPSDK\Model\AccessCode
setAccessTo(\NextEvent\PHPSDK\Model\DateTime|string|null $date) : \NextEvent\PHPSDK\Model\AccessCode
| Throws |
|
|---|
\NextEvent\PHPSDK\Model\AccessCode
setEntryState(\NextEvent\PHPSDK\Model\Device $device, integer $entryState = null, string $connection = 'online', array|null $categories = null, string $processed = null) : \NextEvent\PHPSDK\Model\AccessCode
If the entry state could not be updated, you will receive a validation message from the API.
| see |
\NextEvent\PHPSDK\Model\AccessCode::ENTRY_IN
and \NextEvent\PHPSDK\Model\AccessCode::ENTRY_OUTwhen passing $entryState |
|---|---|
| Throws |
|
integerThe new entry state of the code. If the mode of the gate is not both, the mode of the gate will be used by default.
stringOptional connection parameter. Default is 'online'.
array|nullOptional list of categories to validate. By default the category id of this access code will be set.
stringOptional processed time. Default is the current time of the server this code runs on.
\NextEvent\PHPSDK\Model\AccessCode
setRestClient(\NextEvent\PHPSDK\Rest\Client $restClient) : \NextEvent\PHPSDK\Model\AccessCode
setSource(array $source) : \NextEvent\PHPSDK\Model\MutableModel
| access |
private |
|---|
arrayThe source data as received from the API.
\NextEvent\PHPSDK\Model\MutableModel
spawn(array $data) : \NextEvent\PHPSDK\Model\AccessCode
| Throws |
|
|---|
array
\NextEvent\PHPSDK\Model\AccessCode
toArray() : array
array
toLogContext() : array
Implements the LogContextInterface interface
array
toString() : string
string
unserialize( $serialized)
Implements Serializable interface
STATE_VALID
| var |
|---|
STATE_CANCELLED
| var |
|---|
STATE_EXTERNAL
| var |
|---|
ENTRY_IN
| var |
|---|
ENTRY_OUT
| var |
|---|
ENTRY_NONE
| var |
|---|