Cloudinary\Api::resource PHP Method

resource() public method

public resource ( $public_id, $options = [] )
    function resource($public_id, $options = array())
    {
        $resource_type = \Cloudinary::option_get($options, "resource_type", "image");
        $type = \Cloudinary::option_get($options, "type", "upload");
        $uri = array("resources", $resource_type, $type, $public_id);
        return $this->call_api("get", $uri, $this->only($options, array("exif", "colors", "faces", "image_metadata", "phash", "pages", "coordinates", "max_results")), $options);
    }

Usage Example

Example #1
0
 function test19_delete_derived()
 {
     // should allow deleting all resources
     $this->markTestSkipped("Not enabled by default - remove this line to test");
     Uploader::upload(self::LOGO_PNG, array("public_id" => self::$api_test_5, "eager" => array("transformation" => array("width" => 101, "crop" => "scale"))));
     $resource = $this->api->resource(self::$api_test_5);
     $this->assertNotEquals($resource, NULL);
     $this->assertEquals(count($resource["derived"]), 1);
     $this->api->delete_all_resources(array("keep_original" => True));
     $resource = $this->api->resource(self::$api_test_5);
     $this->assertNotEquals($resource, NULL);
     $this->assertEquals(count($resource["derived"]), 0);
 }
All Usage Examples Of Cloudinary\Api::resource