BaseMediaAsset
abstract class BaseMediaAsset extends BaseAsset implements CommonTransformationInterface
Class BaseMediaAsset
Properties
CloudConfig | $cloud | from BaseAsset | |
UrlConfig | $urlConfig | from BaseAsset | |
AssetDescriptor | $asset | from BaseAsset | |
AuthToken | $authToken | from BaseAsset | |
ImageTransformation|VideoTransformation|Transformation | $transformation |
Methods
Whether to automatically build URLs with multiple CDN sub-domains.
Whether to use secure CDN sub-domain.
The custom domain name to use for building HTTP URLs.
Force HTTPS URLs for resources even if they are embedded in non-secure HTTP pages.
The domain name of the CDN distribution to use for building HTTPS URLs.
Set this parameter to true if you are an Advanced plan user with a private CDN distribution.
Set to true to create a signed Cloudinary URL.
Setting both this and signUrl to true will sign the URL using the first 32 characters of a SHA-256 hash.
Set to true to use shorten asset type.
Set to true to omit type and resource_type in the URL.
Set to false to omit default version string for assets in folders in the delivery URL.
Set to false to omit analytics.
BaseMediaAsset constructor.
Creates a new asset from the provided string (URL).
Creates a new asset from the provided JSON.
Creates a new media asset from the provided public and array of parameters.
Imports data from the provided string (URL).
Imports data from the provided JSON.
Returns the public ID of the asset.
Sets the public ID of the asset.
Serializes to the URL string.
Serializes to string.
No description
Sets the transformation.
Gets the asset transformation.
Adds (appends) a transformation.
Adds (chains) a transformation action.
Sets the asset format.
Details
$this
cdnSubdomain(bool $cdnSubdomain = true)
Whether to automatically build URLs with multiple CDN sub-domains.
$this
secureCdnSubdomain(bool $secureCdnSubdomain = true)
Whether to use secure CDN sub-domain.
$this
cname(string $cname)
The custom domain name to use for building HTTP URLs.
Relevant only for Advanced plan users that have a private CDN distribution and a custom CNAME.
$this
secure(bool $secure = true)
Force HTTPS URLs for resources even if they are embedded in non-secure HTTP pages.
$this
secureCname(string $secureCname)
The domain name of the CDN distribution to use for building HTTPS URLs.
Relevant only for Advanced plan users that have a private CDN distribution.
$this
privateCdn(bool $privateCdn = true)
Set this parameter to true if you are an Advanced plan user with a private CDN distribution.
$this
signUrl(bool $signUrl = true)
Set to true to create a signed Cloudinary URL.
$this
longUrlSignature(bool $longUrlSignature = true)
Setting both this and signUrl to true will sign the URL using the first 32 characters of a SHA-256 hash.
$this
shorten(bool $shorten = true)
Set to true to use shorten asset type.
$this
useRootPath(bool $useRootPath = true)
Set to true to omit type and resource_type in the URL.
$this
forceVersion(bool $forceVersion = true)
Set to false to omit default version string for assets in folders in the delivery URL.
$this
analytics(bool $analytics = true)
Set to false to omit analytics.
__construct($source, mixed $configuration = null)
BaseMediaAsset constructor.
static mixed
fromString(string $string)
Creates a new asset from the provided string (URL).
static mixed
fromJson(string|array $json)
Creates a new asset from the provided JSON.
static mixed
fromParams(string $source, array $params = [])
Creates a new media asset from the provided public and array of parameters.
mixed
importString(string $string)
Imports data from the provided string (URL).
mixed
importJson(string|array $json)
Imports data from the provided JSON.
BaseAsset
configuration(array|Configuration $configuration)
Sets the asset configuration.
BaseAsset
importConfiguration(array|Configuration $configuration)
Imports (merges) the asset configuration.
string
getPublicId(bool $omitExtension = false)
Returns the public ID of the asset.
BaseAsset
setPublicId(string $publicId)
Sets the public ID of the asset.
string
toUrl(CommonTransformation|string $withTransformation = null, bool $append = true)
Serializes to the URL string.
string
__toString()
Serializes to string.
jsonSerialize($includeEmptyKeys = false, $includeEmptySections = false)
BaseMediaAsset
setTransformation(CommonTransformation $transformation)
Sets the transformation.
abstract ImageTransformation|VideoTransformation|Transformation
getTransformation()
Gets the asset transformation.
$this
addTransformation(CommonTransformation|array|string $transformation)
Adds (appends) a transformation.
Appended transformation is nested.
BaseMediaAsset
addAction(BaseAction|BaseQualifier|mixed $action)
Adds (chains) a transformation action.
BaseMediaAsset
setFormat(string $format, bool $useFetchFormat = false)
Sets the asset format.
For non-fetched assets sets the filename extension. For remotely fetched assets sets the 'f_' transformation parameter.