public function setIPFamily($family) { if (in_array($family, array(self::IPFAMILY_IPV4, self::IPFAMILY_IPV6))) { $this->_ipFamily = $family; } else { throw new \Exception("'{$family}' is not a valid address family"); } }