cloudflare / cloudflare-php

PHP library for the Cloudflare v4 API
BSD 3-Clause "New" or "Revised" License
621 stars 222 forks source link

ZoneSettings missing Get all Zone settings method #166

Open Byidi opened 3 years ago

Byidi commented 3 years ago

Hi,

I need to get all the settings for a specific zone, like this endpoint #zone-settings-properties. Which I initially search for in the ZoneSettings class, but I didn't seems to be in this class, neither in the rest of the code.

Is it really missing? Do you plan to add it ?

I was able to get the wanted result by adding this to the ZoneSettings class:


    public function getSettings($zoneID)
    {
        $return = $this->adapter->get(
            'zones/' . $zoneID . '/settings/'
        );
        $body   = json_decode($return->getBody());

        if ($body->success) {
            return $body->result;
        }

        return false;
    }