Skip to content

Add get DNS record ID#93

Merged
IcyApril merged 2 commits intocloudflare:masterfrom
exportsmedia:feature-get-dns-record-id
Jun 7, 2019
Merged

Add get DNS record ID#93
IcyApril merged 2 commits intocloudflare:masterfrom
exportsmedia:feature-get-dns-record-id

Conversation

@exportsmedia
Copy link
Copy Markdown
Contributor

Closes Issue #52
Related to pull request #53

Comment thread src/Endpoints/DNS.php
public function getRecordID(string $zoneID, string $type = '', string $name = ''): string
{
$records = $this->listRecords($zoneID, $type, $name);
if (isset($records->result{0}->id)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider following code snippets:

Since the package requires php-7.0 version it can use this code:

return $records->result{0}->id ?? false;

@IcyApril IcyApril merged commit 6a9a9f5 into cloudflare:master Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants