Endpoint
class Endpoint (View source)
| internal | This class is an internal part of the oEmbed system and should only be instantiated by instances of Drupal\media\OEmbed\Provider. |
Value object for oEmbed provider endpoints.
Properties
| protected string | $url | The endpoint's URL. |
|
| protected Provider | $provider | The provider this endpoint belongs to. |
|
| protected string[] | $schemes | List of URL schemes supported by the provider. |
|
| protected string[] | $formats | List of supported formats. Only 'json' and 'xml' are allowed. |
|
| protected bool | $supportsDiscovery | Whether the provider supports oEmbed discovery. |
Methods
Endpoint constructor.
Returns the endpoint URL.
Returns the provider this endpoint belongs to.
Returns list of URL schemes supported by the provider.
Returns list of supported formats.
Returns whether the provider supports oEmbed discovery.
Tries to match a URL against the endpoint schemes.
Builds and returns the endpoint URL.
Details
__construct(string $url, Provider $provider, array $schemes = [], array $formats = [], bool $supports_discovery = FALSE)
Endpoint constructor.
string
getUrl()
Returns the endpoint URL.
The URL will be built with the first available format. If the endpoint does not provide any formats, JSON will be used.
Provider
getProvider()
Returns the provider this endpoint belongs to.
string[]
getSchemes()
Returns list of URL schemes supported by the provider.
string[]
getFormats()
Returns list of supported formats.
bool
supportsDiscovery()
Returns whether the provider supports oEmbed discovery.
bool
matchUrl(string $url)
Tries to match a URL against the endpoint schemes.
string
buildResourceUrl(string $url)
Builds and returns the endpoint URL.
In most situations this function should not be used. Your are probably looking for \Drupal\media\OEmbed\UrlResolver::getResourceUrl(), because it is alterable and also cached.