class FeedsSimplePieEnclosure in Feeds 7.2
Same name and namespace in other branches
- 6 plugins/FeedsSimplePieParser.inc \FeedsSimplePieEnclosure
- 7 plugins/FeedsSimplePieParser.inc \FeedsSimplePieEnclosure
Adapter to present SimplePie_Enclosure as FeedsEnclosure object.
Hierarchy
- class \FeedsElement
- class \FeedsEnclosure
- class \FeedsSimplePieEnclosure
- class \FeedsEnclosure
Expanded class hierarchy of FeedsSimplePieEnclosure
File
- plugins/
FeedsSimplePieParser.inc, line 11 - Contains FeedsSimplePieParser and related classes.
View source
class FeedsSimplePieEnclosure extends FeedsEnclosure {
protected $simplepie_enclosure;
private $_serialized_simplepie_enclosure;
/**
* Constructor requires SimplePie enclosure object.
*/
public function __construct(SimplePie_Enclosure $enclosure) {
$this->simplepie_enclosure = $enclosure;
}
/**
* Serialization helper.
*
* Handle the simplepie enclosure class separately ourselves.
*/
public function __sleep() {
$this->_serialized_simplepie_enclosure = serialize($this->simplepie_enclosure);
return array(
'_serialized_simplepie_enclosure',
);
}
/**
* Unserialization helper.
*
* Ensure that the simplepie class definitions are loaded for the enclosure when unserializing.
*/
public function __wakeup() {
feeds_include_simplepie();
$this->simplepie_enclosure = unserialize($this->_serialized_simplepie_enclosure);
}
/**
* Override parent::getValue().
*/
public function getValue() {
return $this->simplepie_enclosure
->get_link();
}
/**
* Override parent::getMIMEType().
*/
public function getMIMEType() {
return $this->simplepie_enclosure
->get_real_type();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsElement:: |
protected | property | The standard value of this element. This value can contain be a simple type, a FeedsElement or an array of either. | |
FeedsElement:: |
public | function | Magic method __toString() for printing and string conversion of this object. | |
FeedsEnclosure:: |
protected | property | The default list of allowed extensions. | |
FeedsEnclosure:: |
protected | property | The mime type of the enclosure. | |
FeedsEnclosure:: |
protected | property | The sanitized local file name. | |
FeedsEnclosure:: |
public | function | Downloads the content from the file URL. | |
FeedsEnclosure:: |
public | function | Get a Drupal file object of the enclosed resource, download if necessary. | |
FeedsEnclosure:: |
public | function | Returns the file name transformed for better local saving. | |
FeedsEnclosure:: |
protected | function | Returns the safe file name. | |
FeedsEnclosure:: |
public | function | Returns the full path to the file URI with a safe file name. | |
FeedsEnclosure:: |
public | function | Use this method instead of FeedsElement::getValue() when fetching the file from the URL. | |
FeedsEnclosure:: |
public | function | Sets the list of allowed extensions. | |
FeedsSimplePieEnclosure:: |
protected | property | ||
FeedsSimplePieEnclosure:: |
private | property | ||
FeedsSimplePieEnclosure:: |
public | function |
Override parent::getMIMEType(). Overrides FeedsEnclosure:: |
|
FeedsSimplePieEnclosure:: |
public | function |
Override parent::getValue(). Overrides FeedsElement:: |
|
FeedsSimplePieEnclosure:: |
public | function |
Constructor requires SimplePie enclosure object. Overrides FeedsEnclosure:: |
|
FeedsSimplePieEnclosure:: |
public | function | Serialization helper. | |
FeedsSimplePieEnclosure:: |
public | function | Unserialization helper. |