/** * Delete records from a template. * @param integer $templateId The id of the template. * @param array|integer $recordId If deleting multiple records, an array of record ids, otherwise just the record id to delete a single record. * @return \DNSMadeEasy\Result */ public function delete($templateId, $recordId) { if (is_array($recordId)) { return $this->_driver->delete("/dns/template/{$templateId}/records?ids=" . implode($recordId, '&ids=')); } else { return $this->_driver->delete("/dns/template/{$templateId}/records/{$recordId}"); } }
/** * Delete secondary dns records from a domain. * @param integer $domainId The id of the domain. * @param integer $recordId If deleting multiple records, an array of record ids, otherwise just the record id to delete a single record. * @return \DNSMadeEasy\Result */ public function delete($domainId, $recordId) { if (is_array($recordId)) { return $this->_driver->delete("/dns/secondary/{$domainId}/records?ids=" . implode($recordId, '&ids=')); } else { return $this->_driver->delete("/dns/secondary/{$domainId}/records/{$recordId}"); } }
/** * Delete one or multiple secondary dns domains. * @param array|integer $id An array of domain ids if deleting multiple domains or an integer if deleting one domain. * @return \DNSMadeEasy\Result */ public function delete($id) { if (is_array($id)) { $data = $id; } else { $data = array($id); } return $this->_driver->delete("/dns/secondary/", $data); }
/** * @covers DNSMadeEasy\driver\REST::post * @covers DNSMadeEasy\driver\REST::put * @covers DNSMadeEasy\driver\REST::delete */ public function testPostPutAndDelete() { $config = array('name' => 'PHPLibraryTest', 'email' => 'php.library.com', 'ttl' => 86400, 'comp' => 'ns.phplibrarytest.com', 'serial' => 2012020203, 'refresh' => 14400, 'retry' => 1800, 'expire' => 86400, 'negativeCache' => 1800); //POST $result = $this->rest->post('/dns/soa', $config); $this->assertTrue($result->success, "Creating the SoA was unsuccessful"); $this->assertInstanceOf('DNSMadeEasy\\Result', $result, 'The result should be of the type DNSMadeEasy\\Result'); $this->assertEquals('PHPLibraryTest', $result->body->name, "The created SoA does not match"); $id = $result->body->id; //PUT $config['email'] = 'php2.library.com'; $result = $this->rest->put("/dns/soa/{$id}", $config); $this->assertTrue($result->success, "Updating the SoA was unsuccessful"); //DELETE $result = $this->rest->delete("/dns/soa/{$id}"); $this->assertTrue($result->success, "Deleting the SoA was unsuccessful"); }
/** * Delete all domains. * @return \DNSMadeEasy\Result */ public function deleteAll() { $domains = $this->getAll(); $ids = array(); foreach ($domains->body->data as $domain) { $ids[] = $domain->id; } if (!empty($ids)) { return $this->_driver->delete("/dns/managed/", $ids); } else { return false; } }
/** * Delete a SoA record by its id. * @param integer $id The id of the SoA record. * @return \DNSMadeEasy\Result */ public function delete($id) { return $this->_driver->delete("/dns/soa/{$id}"); }
/** * Delete a failover monitor. * @param integer $id The id of the failover monitor. * @return \DNSMadeEasy\Result */ public function delete($id) { return $this->_driver->delete("/monitor/{$id}"); }
/** * Delete a folder by its id. * @param integer $id The folder to delete. * @return \DNSMadeEasy\Result */ public function delete($id) { return $this->_driver->delete("/security/folder/{$id}"); }
/** * Delete a transfer ACL by its id. * @param integer $id The id of the transfer ACL. * @return \DNSMadeEasy\Result */ public function delete($id) { return $this->_driver->delete("/dns/transferAcl/{$id}"); }