-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathQVariant.php
More file actions
38 lines (33 loc) · 982 Bytes
/
QVariant.php
File metadata and controls
38 lines (33 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Clue\QDataStream;
class QVariant
{
private $value;
private $type;
/**
* Create a new QVariant with the given explicit type
*
* You can use this class to explicitly define the types of your data instead
* of relying on automatic guessing.
*
* Technically, Qt would represent a QVariant with a custom QUserType as two
* nested objects. For ease of use, this library instead uses string identifiers
* on the (outer) QVariant to mark it as a QUserType.
*
* @param mixed $value the variant's native value to transport
* @param int|string $type type constant (see Types) for built-in types or a string for custom UserTypes
*/
public function __construct($value, $type)
{
$this->value = $value;
$this->type = $type;
}
public function getValue()
{
return $this->value;
}
public function getType()
{
return $this->type;
}
}