class ParserIcalFeedsParser in iCal feed parser 6.2
Same name and namespace in other branches
- 7 includes/ParserIcalFeedsParser.inc \ParserIcalFeedsParser
Class definition for iCal date module Parser.
Parses iCal feeds using the iCal parser included with the date module.
Hierarchy
- class \FeedsConfigurable
- class \FeedsPlugin implements FeedsSourceInterface
- class \FeedsParser
- class \ParserIcalFeedsParser
- class \FeedsParser
- class \FeedsPlugin implements FeedsSourceInterface
Expanded class hierarchy of ParserIcalFeedsParser
2 string references to 'ParserIcalFeedsParser'
- ParserIcalFeedsTestCase::createConfiguredFeed in tests/
parser_ical_feeds.test - Basic test configured feed item, to import feed into.
- parser_ical_feeds_plugins in ./
parser_ical.module - Implementation of ctools plugin for feeds hook_feeds_plugins().
File
- includes/
ParserIcalFeedsParser.inc, line 107
View source
class ParserIcalFeedsParser extends FeedsParser {
/**
* Parse content fetched by fetcher.
*/
public function parse(FeedsImportBatch $batch, FeedsSource $source) {
module_load_include('inc', 'parser_ical', 'parser_ical.dateapi');
$result = _parser_ical_parse($batch
->getRaw());
$batch
->setTitle($result['title']);
$batch
->setItems($result['items']);
// also available description, calscale, timezone
}
/**
* Return mapping sources.
*
* At a future point, we could expose data type information here,
* storage systems like Data module could use this information to store
* parsed data automatically in fields with a correct field type.
*/
public function getMappingSources() {
return array(
'title' => array(
'name' => t('Title'),
'description' => t('Title of the feed item.'),
),
'description' => array(
'name' => t('Description'),
'description' => t('Description of the feed item.'),
),
// 'author' => t('Author'), // not implemented
'timestamp' => array(
'name' => t('Published date'),
'description' => t('Published date as UNIX time UTC of the feed item.'),
),
'url' => array(
'name' => t('Item URL (link)'),
'description' => t('URL of the feed item.'),
),
'guid' => array(
'name' => t('Item GUID'),
'description' => t('Global Unique Identifier of the feed item.'),
),
'tags' => array(
'name' => t('Categories'),
'description' => t('An array of categories that have been assigned to the feed item.'),
),
'ical_date' => array(
'name' => t('iCal Date'),
'description' => t('iCal date associated with item as an array.'),
),
'ical_location' => array(
'name' => t('iCal location string'),
'description' => t('The location string associated with an item.'),
),
) + parent::getMappingSources();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | CTools export enabled status of this object. | |
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
public | function | Similar to setConfig but adds to existing configuration. | 1 |
FeedsConfigurable:: |
public | function | Return default configuration. | 6 |
FeedsConfigurable:: |
public | function | Return configuration form for this object. The keys of the configuration form must match the keys of the array returned by configDefaults(). | 10 |
FeedsConfigurable:: |
public | function | Submission handler for configForm(). | 3 |
FeedsConfigurable:: |
public | function | Validation handler for configForm(). | 3 |
FeedsConfigurable:: |
public | function | Copy a configuration. | 1 |
FeedsConfigurable:: |
public | function | Determine whether this object is persistent and enabled. I. e. it is defined either in code or in the database and it is enabled. | 1 |
FeedsConfigurable:: |
public | function | Implementation of getConfig(). | 1 |
FeedsConfigurable:: |
public static | function | Instantiate a FeedsConfigurable object. | 1 |
FeedsConfigurable:: |
public | function | Set configuration. | 1 |
FeedsConfigurable:: |
public | function | Override magic method __get(). Make sure that $this->config goes through getConfig() | |
FeedsConfigurable:: |
public | function | Override magic method __isset(). This is needed due to overriding __get(). | |
FeedsParser:: |
public | function | Clear all caches for results for given source. | |
FeedsParser:: |
public | function | Get an element identified by $element_key of the given item. The element key corresponds to the values in the array returned by FeedsParser::getMappingSources(). | 1 |
FeedsPlugin:: |
public | function |
Returns TRUE if $this->sourceForm() returns a form. Overrides FeedsSourceInterface:: |
|
FeedsPlugin:: |
protected static | function | Loads on-behalf implementations from mappers/ directory. | |
FeedsPlugin:: |
public | function |
Save changes to the configuration of this object.
Delegate saving to parent (= Feed) which will collect
information from this object by way of getConfig() and store it. Overrides FeedsConfigurable:: |
|
FeedsPlugin:: |
public | function |
Implementation of FeedsSourceInterface::sourceDefaults(). Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
public | function |
A source is being deleted. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
public | function |
Callback methods, exposes source form. Overrides FeedsSourceInterface:: |
3 |
FeedsPlugin:: |
public | function |
Validation handler for sourceForm. Overrides FeedsSourceInterface:: |
2 |
FeedsPlugin:: |
public | function |
A source is being saved. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
protected | function |
Constructor. Overrides FeedsConfigurable:: |
|
ParserIcalFeedsParser:: |
public | function |
Return mapping sources. Overrides FeedsParser:: |
|
ParserIcalFeedsParser:: |
public | function |
Parse content fetched by fetcher. Overrides FeedsParser:: |