\DeviceAtlasProperty

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

Summary

Methods
Properties
Constants
build()
buildCollectionOfValues()
getDataTypeId()
getDataType()
value()
asBoolean()
asInteger()
asSet()
asString()
__toString()
toString()
equals()
No public properties found
No constants found
No protected methods found
$v
$dTI
$iCOV
N/A
__construct()
getValueAsInteger()
getValueAsBoolean()
$NOT_CONVERTIBLE_TO_BOOLEAN
$NOT_CONVERTIBLE_TO_INT
N/A

Properties

$v

$v : 

Type

$dTI

$dTI : 

Type

$iCOV

$iCOV : 

Type

$NOT_CONVERTIBLE_TO_BOOLEAN

$NOT_CONVERTIBLE_TO_BOOLEAN : 

Type

$NOT_CONVERTIBLE_TO_INT

$NOT_CONVERTIBLE_TO_INT : 

Type

Methods

build()

build(  $value,   $dataTypeId,   $isCollectionOfValues = false) : \DeviceAtlas\Property

Parameters

$value

string|bool|int|array The value to store

$dataTypeId

int The type of the value to store. Data types are defined in class DataType.

$isCollectionOfValues

bool Indicates if the Property will contain a single value or multiple values

Throws

\DeviceAtlas\Exception\IncorrectPropertyTypeException

Returns

\DeviceAtlas\Property

buildCollectionOfValues()

buildCollectionOfValues(  $values,   $dataTypeId) 

Parameters

$values
$dataTypeId
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getDataTypeId()

getDataTypeId() : integer

Get the data type ID for values associated with this Property.

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

integer —

The ID of the data type

getDataType()

getDataType() : string

Get the data type name for values associated with this Property.

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

string —

The name of the data type

value()

value() : object

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

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

object —

The raw Object value.

asBoolean()

asBoolean() : boolean

Get the value of the property as a boolean.

Throws

\DeviceAtlas\Exception\IncorrectPropertyTypeException

Thrown if the type of the value is not a DataType::BOOLEAN

Returns

boolean —

The boolean value of the property.

asInteger()

asInteger() : integer

Get the value of the property as an int.

Throws

\DeviceAtlas\Exception\IncorrectPropertyTypeException

Thrown if the type of the value is not compatible with a DDataType::INTEGER

Returns

integer —

The integer value of the property.

asSet()

asSet() : array

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.

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

array —

A set of values.

asString()

asString() : string

Get the value of the property as a String. Alias for toString().

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

string —

The string value of the property

__toString()

__toString() : string

Get the value of the property as a String. Alias for toString().

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

string —

The string value of the property

toString()

toString() : string

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

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

string —

The string value of the property

equals()

equals(  $obj) : boolean

Compare two instances of this class.

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

Parameters

$obj

object to be compared against

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

boolean —

Compare result

__construct()

__construct(  $value,   $dataTypeId,   $isCollectionOfValues = false) 

Create a new Property with a value and data type.

Parameters

$value

string|bool|int The value to store

$dataTypeId

int The type of the value to store. Data types are defined in class DataType.

$isCollectionOfValues

bool Indicates if the Property will contain a single value or multiple values

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getValueAsInteger()

getValueAsInteger(  $stringValue) 

Parameters

$stringValue
Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in /opt/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

getValueAsBoolean()

getValueAsBoolean(  $value) : boolean

Parameters

$value

Throws

\DeviceAtlas\Exception\IncorrectPropertyTypeException

Returns

boolean