1 <?php
2
3 namespace MaxMind\MinFraud\Model;
4
5 /**
6 * Model with information about the device.
7 *
8 * In order to receive device output from minFraud Insights or minFraud
9 * Factors, you must be using the Device Tracking Add-on.
10 * @package MaxMind\MinFraud\Model
11 * @link https://dev.maxmind.com/minfraud/device/ Device Tracking Add-on
12 *
13 * @property-read float|null $confidence This number represents our confidence that
14 * the `device_id` refers to a unique device as opposed to a cluster of
15 * similar devices. A confidence of 0.01 indicates very low confidence that
16 * the device is unique, whereas 99 indicates very high confidence.
17 * @property-read string|null $id A UUID that MaxMind uses for the device associated
18 * with this IP address. Note that many devices cannot be uniquely identified
19 * because they are too common (for example, all iPhones of a given model and
20 * OS release). In these cases, the minFraud service will simply not return a
21 * UUID for that device.
22 * @property-read string|null $lastSeen This is the date and time of the last
23 * sighting of the device. This is an RFC 3339 date-time.
24 */
25 class Device extends AbstractModel
26 {
27 /**
28 * @internal
29 */
30 protected $confidence;
31
32 /**
33 * @internal
34 */
35 protected $id;
36
37 /**
38 * @internal
39 */
40 protected $lastSeen;
41
42 public function __construct($response, $locales = ['en'])
43 {
44 parent::__construct($response, $locales);
45 $this->confidence = $this->safeArrayLookup($response['confidence']);
46 $this->id = $this->safeArrayLookup($response['id']);
47 $this->lastSeen = $this->safeArrayLookup($response['last_seen']);
48 }
49 }
50