Documentation

Mobi_Mtld_DA_Property
in package

Contains a property value. The value can be fetched as a generic Object or one of the convenience asXXXX methods can be used to get the value in a specific type.

Tags
copyright

Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. https://deviceatlas.com

author

DeviceAtlas Limited

Table of Contents

$dataTypeId  : mixed
$NOT_CONVERTIBLE_TO_BOOLEAN  : mixed
$NOT_CONVERTIBLE_TO_INT  : mixed
$value  : mixed
__construct()  : mixed
Create a new Property with a value and data type.
__toString()  : The
Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.
asBoolean()  : The
Get the value of the property as a boolean.
asInteger()  : The
Get the value of the property as an integer.
asSet()  : A
Gets a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data type.
asString()  : The
Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.
equals()  : bool
Compare two instances of this class.
getDataType()  : string
Get the type name of this property.
getDataTypeId()  : byte
Get the type of this property.
toString()  : The
Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.
value()  : The
Get the value of this property. This needs to be cast to the appropriate type such to be used. E.g. value = (int)$property->value();

Properties

$NOT_CONVERTIBLE_TO_BOOLEAN

private static mixed $NOT_CONVERTIBLE_TO_BOOLEAN = 'Property is not convertible to a boolean.'

$NOT_CONVERTIBLE_TO_INT

private static mixed $NOT_CONVERTIBLE_TO_INT = 'Property is not convertible to an int.'

Methods

__construct()

Create a new Property with a value and data type.

public __construct(mixed $value, mixed $dataTypeId) : mixed
Parameters
$value : mixed
$dataTypeId : mixed
Return values
mixed

__toString()

Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.

public __toString() : The
Return values
The

string value of the property

asSet()

Gets a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data type.

public asSet() : A
Return values
A

set of values.

asString()

Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.

public asString() : The
Return values
The

string value of the property.

equals()

Compare two instances of this class.

public equals( $obj) : bool

If both have equal values and data type then returns true.

Parameters
$obj :

object to be compared against

Return values
bool

Compare result

getDataType()

Get the type name of this property.

public getDataType() : string

See Mobi_Mtld_DA_DataType for a full list of data types.

Return values
string

The data type name of this property.

getDataTypeId()

Get the type of this property.

public getDataTypeId() : byte

See Mobi_Mtld_DA_DataType for a full list of data types.

Return values
byte

The data type ID of this property.

toString()

Get the value of the property as string. Alias for asString(). If a property has multiple possible values then the values are concatenated with a comma.

public toString() : The
Return values
The

string value of the property

value()

Get the value of this property. This needs to be cast to the appropriate type such to be used. E.g. value = (int)$property->value();

public value() : The
Return values
The

raw property value.

Search results