'IPv4', self::IP6 => 'IPv6', self::NAME => 'Hostname', self::IP4_CASCADE => 'IPv4_cas', self::IP6_CASCADE => 'IPv6_cas', self::FREE_FORM => 'free_form' ); public function __construct($value) { $this->initInstance('InstAddrSel', self::$defd_vals, $value); } public static function fromHostAddrSel(HostAddrSel $s) { switch ($s->getValue()) { case HostAddrSel::FREE_FORM: return new InstAddrSel(self::FREE_FORM); break; case HostAddrSel::IP4: return new InstAddrSel(self::IP4); break; case HostAddrSel::IP6: return new InstAddrSel(self::IP6); break; case HostAddrSel::NAME: return new InstAddrSel(self::NAME); break; default: throw new Exception("cannot convert HostAddrSel $s to InstAddrSel"); } } }