1: <?php
2:
3: namespace GeoIp2\Model;
4:
5: /**
6: * This class provides the GeoIP2 Anonymous IP model.
7: *
8: * @property-read bool $isAnonymous This is true if the IP address belongs to
9: * any sort of anonymous network.
10: * @property-read bool $isAnonymousVpn This is true if the IP address is
11: * registered to an anonymous VPN provider. If a VPN provider does not
12: * register subnets under names associated with them, we will likely only
13: * flag their IP ranges using the isHostingProvider property.
14: * @property-read bool $isHostingProvider This is true if the IP address belongs
15: * to a hosting or VPN provider (see description of isAnonymousVpn property).
16: * @property-read bool $isPublicProxy This is true if the IP address belongs to
17: * a public proxy.
18: * @property-read bool $isTorExitNode This is true if the IP address is a Tor
19: * exit node.
20: * @property-read string $ipAddress The IP address that the data in the model is
21: * for.
22: */
23: class AnonymousIp extends AbstractModel
24: {
25: protected $isAnonymous;
26: protected $isAnonymousVpn;
27: protected $isHostingProvider;
28: protected $isPublicProxy;
29: protected $isTorExitNode;
30: protected $ipAddress;
31:
32: /**
33: * @ignore
34: *
35: * @param mixed $raw
36: */
37: public function __construct($raw)
38: {
39: parent::__construct($raw);
40:
41: $this->isAnonymous = $this->get('is_anonymous');
42: $this->isAnonymousVpn = $this->get('is_anonymous_vpn');
43: $this->isHostingProvider = $this->get('is_hosting_provider');
44: $this->isPublicProxy = $this->get('is_public_proxy');
45: $this->isTorExitNode = $this->get('is_tor_exit_node');
46: $this->ipAddress = $this->get('ip_address');
47: }
48: }
49: