<?php

namespace MGModule\DNSManager2\mgLibs\custom\dns\record\type;

/**
 * rfc3403
 */
class NAPTR extends RecordTypeAbstract {
    public $order;
    public $preference;
    public $flags;
    public $services; //?
    public $regexp;
    public $replacement;

    /**
     * @param int $order number from 0 to 65535, lower number higher priority
     * @return bool
     */
    public function orderValidate($order){
        return is_numeric(trim($order));
    }
    /**
     * @param int $preference number from 0 to 65535, lower number higher priority same as order
     * @return bool
     */
    public function preferenceValidate($preference){
        return is_numeric(trim($preference));
    }

    /**
     * @param string $services string od digits and numbers
     * @return bool
     */
    public function servicesValidate($services){
        return (bool)preg_match('/[a-z0-9]+/i', $services);
    }
}
