opensrs\domains\provisioning\ProvisioningUpdateAllInfo::_validateObject PHP Method

_validateObject() public method

Validate the object
public _validateObject ( $dataObject, $requiredFields = null )
    public function _validateObject($dataObject, $requiredFields = null)
    {
        // make sure contact fields are all sent
        $this->checkContactFields($dataObject->attributes->contact_set);
        if (!isset($dataObject->attributes->nameserver_names) || $dataObject->attributes->nameserver_names == '') {
            throw new Exception('oSRS Error - The function requires at least one nameserver is provided.');
        }
        //Check there are the samenumber of Nameserver IP values are there are  Nameserver Name values
        if (isset($dataObject->attributes->nameserver_ips) && $dataObject->attributes->nameserver_ips != '') {
            if (count(explode(',', $dataObject->attributes->nameserver_ips)) != count(explode(',', $dataObject->attributes->nameserver_names))) {
                throw new Exception('oSRS Error - The function requires the same number of Nameserver IP addresses as Nameserver names if you are defining Nameserver IP addresses.');
            }
        }
        $parent = new parent();
        $parent->_validateObject($dataObject, $this->requiredFields);
    }