<?php

class DNSRecordType
{

    const A = '0';
    const CNAME = '1';
    const MX = '2';
    const NS = '3';

    public static function getDNSRecordType($type)
    {
        $typeAsString = 'undefined';
        switch ($type) {
            case DNSRecordType::A:
                $typeAsString = 'A';
                break;
            case DNSRecordType::CNAME:
                $typeAsString = 'CNAME';
                break;
            case DNSRecordType::MX:
                $typeAsString = 'MX';
                break;
            case DNSRecordType::NS:
                $typeAsString = 'NS';
                break;
        }
        return $typeAsString;
    }

    public static function getDNSRecordTypesArray()
    {
        return array(
            '' => '',
            DNSRecordType::A => DNSRecordType::getDNSRecordType(DNSRecordType::A),
            DNSRecordType::CNAME => DNSRecordType::getDNSRecordType(DNSRecordType::CNAME),
            DNSRecordType::MX => DNSRecordType::getDNSRecordType(DNSRecordType::MX),
            DNSRecordType::NS => DNSRecordType::getDNSRecordType(DNSRecordType::NS)
        );
    }
}
