Пример #1
0
 /**
  * Delete nameserver host
  * @access public
  * @param NameserverHost $ns
  * @return bool 
  */
 public function DeleteNameserverHost(NameserverHost $ns)
 {
     $this->FireEvent('BeforeDeleteNameserverHost', $ns);
     try {
         $Resp = $this->RegModule->DeleteNameserverHost($ns);
         $this->ValidateModuleResponse($Resp, 'DeleteNameserverHostResponse');
     } catch (ObjectNotExistsException $e) {
         // Sync our database with registry
         $Resp = new DeleteNameserverHostResponse(REGISTRY_RESPONSE_STATUS::SUCCESS, null, 1000);
         $Resp->Result = true;
     }
     if ($Resp->IsFailed()) {
         Log::Log(sprintf('DeleteNameserverHost failed. Registry error: %s', $Resp->ErrMsg), E_USER_ERROR);
         throw new RegistryException($Resp->ErrMsg, $Resp->Code);
     }
     if ($Resp->Succeed()) {
         $this->FireEvent('NameserverHostDeleted', $ns);
     } else {
         if ($Resp->Pending()) {
             $this->AddPendingOperation($ns, self::OP_DELETE, $Resp->OperationId);
         }
     }
     return true;
 }