public function setIp($ip) { $ip = trim($ip); if (is_string($ip) and $this->getNetwork() != null and Ip::isValidIp($ip, $this->getNetwork()->getIpv())) { if ($this->getNetwork()->getIpv() == 6) { $this->ip = (string) Ip::ipv6Expand($ip); return true; } elseif ($this->getNetwork()->getIpv() == 4) { $this->ip = $ip; return true; } } return false; }
public function setIp($ip) { if (is_string($ip) and Ip::isValidIp($ip, $this->getIpv())) { $this->ip = $ip; if ($this->getIpv() == 6) { $this->ip = (string) Ip::ipv6Expand($this->ip); } } }