Cloudinary\Api::update_transformation PHP Method

update_transformation() public method

# updates - currently only supported update is the "allowed_for_strict" boolean flag
public update_transformation ( $transformation, $updates = [], $options = [] )
    function update_transformation($transformation, $updates = array(), $options = array())
    {
        $uri = array("transformations", $this->transformation_string($transformation));
        $params = $this->only($updates, array("allowed_for_strict"));
        if (isset($updates["unsafe_update"])) {
            $params["unsafe_update"] = $this->transformation_string($updates["unsafe_update"]);
        }
        return $this->call_api("put", $uri, $params, $options);
    }

Usage Example

Example #1
0
 function test15a_transformation_unsafe_update()
 {
     // should allow unsafe update of named transformation
     $this->api->create_transformation(self::$api_test_transformation_3, array("crop" => "scale", "width" => 102));
     $this->api->update_transformation(self::$api_test_transformation_3, array("unsafe_update" => array("crop" => "scale", "width" => 103)));
     $transformation = $this->api->transformation(self::$api_test_transformation_3);
     $this->assertNotEquals($transformation, NULL);
     $this->assertEquals($transformation["info"], array(array("crop" => "scale", "width" => 103)));
     $this->assertEquals($transformation["used"], FALSE);
 }