Cloudflare\Zone\Pagerules::change PHP Method

change() public method

Change a page rule [BETA] (permission needed: #zone:edit)
public change ( string $zone_identifier, string $identifier, array | null $targets = null, array | null $actions = null, integer | null $priority = null, string | null $status = null )
$zone_identifier string API item identifier tag
$identifier string
$targets array | null Targets to evaluate on a request
$actions array | null The set of actions to perform if the targets of this rule match the request. Actions can redirect the url to another url or override settings (but not both)
$priority integer | null A number that indicates the preference for a page rule over another. In the case where you may have a catch-all page rule (e.g., #1: '/images/') but want a rule that is more specific to take precedence (e.g., #2: '/images/special/'), you'll want to specify a higher priority on the latter (#2) so it will override the first.
$status string | null Status of the page rule
    public function change($zone_identifier, $identifier, $targets = null, $actions = null, $priority = null, $status = null)
    {
        $data = ['targets' => $targets, 'actions' => $actions, 'priority' => $priority, 'status' => $status];
        return $this->patch('zones/' . $zone_identifier . '/pagerules/' . $identifier, $data);
    }