class InstagramFeedsPluginsEnclosure in Instagram Feeds 7
Enclosure element, can be part of the result array.
Hierarchy
- class \InstagramFeedsPluginsEnclosure extends \FeedsEnclosure
Expanded class hierarchy of InstagramFeedsPluginsEnclosure
File
- modules/
instagram_feeds_plugins/ plugins/ feeds/ InstagramFeedsPluginsPager.inc, line 232 - Home of the InstagramFeedsPluginsPager.
View source
class InstagramFeedsPluginsEnclosure extends FeedsEnclosure {
protected $mimetype;
/**
* Constructor, requires MIME type.
*
* @param string $value
* A path to a local file or a URL to a remote document.
* @param string $mimetype
* The mime type of the resource.
*/
public function __construct($value, $mimetype) {
parent::__construct($value, $mimetype);
$this->mimetype = $mimetype;
}
/**
* Get the content of the referenced resource.
*
* @return array()
* The content of the referenced resource.
*/
public function getContent() {
feeds_include_library('http_request.inc', 'http_request');
$result = http_request_get($this
->getUrlEncodedValue(), NULL, NULL, TRUE);
if ($result->code != 200) {
throw new Exception(t('Download of @url failed with code !code.', array(
'@url' => $this
->getUrlEncodedValue(),
'!code' => $result->code,
)));
}
return $result->data;
}
}Members
|
Name |
Modifiers | Type | Description | Overrides |
|---|---|---|---|---|
|
InstagramFeedsPluginsEnclosure:: |
protected | property | ||
|
InstagramFeedsPluginsEnclosure:: |
public | function | Get the content of the referenced resource. | |
|
InstagramFeedsPluginsEnclosure:: |
public | function | Constructor, requires MIME type. |