Cloudflare\Zone\Dns::update PHP Method

update() public method

Update DNS record (permission needed: #dns_records:edit)
public update ( string $zone_identifier, string $identifier, string | null $type = null, string | null $name = null, string | null $content = null, string | null $ttl = null, boolean | null $proxied = null, array | null $data = null, integer | null $priority = null )
$zone_identifier string
$identifier string API item identifier tag
$type string | null DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
$name string | null DNS record name
$content string | null DNS record content
$ttl string | null Time to live for DNS record. Value of 1 is 'automatic'
$proxied boolean | null Whether to proxy the domain through CloudFlare or not
$data array | null Additional data required for SRV record
$priority integer | null MX record priority value
    public function update($zone_identifier, $identifier, $type = null, $name = null, $content = null, $ttl = null, $proxied = null, $data = null, $priority = null)
    {
        $data = ['type' => $type, 'name' => $name, 'content' => $content, 'ttl' => $ttl, 'proxied' => $proxied, 'priority' => $priority, 'data' => $data];
        return $this->put('zones/' . $zone_identifier . '/dns_records/' . $identifier, $data);
    }