public static function fromRawData($rawData) { $fields = parent::prepareFields($rawData); $ip = new IPAddress($fields['IP address']); $hwType = new Integer(hexdec($fields['HW type'])); $flags = new Integer(hexdec($fields['Flags'])); $hwAddress = new MacAddress($fields['HW address']); $mask = new StringLiteral($fields['Mask']); $device = new StringLiteral($fields['Device']); return new static($ip, $hwType, $flags, $hwAddress, $mask, $device); }
public static function fromRawData($rawData) { $fields = parent::prepareFields($rawData); $mac = $fields['MAC Addr']; $ip = $fields['IP Addr']; $lease = $fields['Lease Time Remaining']; $host = $fields['Hostname']; $macAddress = new MacAddress($mac); $ipAddress = new IPAddress($ip); $leaseTimeOut = new Integer($lease); $hostName = new Hostname($host); return new self($macAddress, $ipAddress, $leaseTimeOut, $hostName); }