Rss.php in Zircon Profile 8
Same filename in this branch
- 8 vendor/zendframework/zend-feed/src/Reader/Entry/Rss.php
- 8 vendor/zendframework/zend-feed/src/Reader/Feed/Rss.php
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Rss.php
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Rss.php
- 8 core/modules/views/src/Plugin/views/style/Rss.php
- 8 core/modules/node/src/Plugin/views/row/Rss.php
- 8 core/modules/comment/src/Plugin/views/row/Rss.php
- 8 core/modules/aggregator/src/Plugin/views/row/Rss.php
Same filename and directory in other branches
Contains \Drupal\aggregator\Plugin\views\row\Rss.
Namespace
Drupal\aggregator\Plugin\views\rowFile
core/modules/aggregator/src/Plugin/views/row/Rss.phpView source
<?php
/**
* @file
* Contains \Drupal\aggregator\Plugin\views\row\Rss.
*/
namespace Drupal\aggregator\Plugin\views\row;
use Drupal\views\Plugin\views\row\RssPluginBase;
/**
* Defines a row plugin which loads an aggregator item and renders as RSS.
*
* @ViewsRow(
* id = "aggregator_rss",
* theme = "views_view_row_rss",
* title = @Translation("Aggregator item"),
* help = @Translation("Display the aggregator item using the data from the original source."),
* base = {"aggregator_item"},
* display_types = {"feed"}
* )
*/
class Rss extends RssPluginBase {
/**
* The table the aggregator item is using for storage.
*
* @var string
*/
public $base_table = 'aggregator_item';
/**
* The actual field which is used to identify a aggregator item.
*
* @var string
*/
public $base_field = 'iid';
/**
* {@inheritdoc}
*/
protected $entityTypeId = 'aggregator_item';
/**
* {@inheritdoc}
*/
public function render($row) {
$entity = $row->_entity;
$item = new \stdClass();
foreach ($entity as $name => $field) {
$item->{$name} = $field->value;
}
$item->elements = array(
array(
'key' => 'pubDate',
// views_view_row_rss takes care about the escaping.
'value' => gmdate('r', $entity->timestamp->value),
),
array(
'key' => 'dc:creator',
// views_view_row_rss takes care about the escaping.
'value' => $entity->author->value,
),
array(
'key' => 'guid',
// views_view_row_rss takes care about the escaping.
'value' => $entity->guid->value,
'attributes' => array(
'isPermaLink' => 'false',
),
),
);
$build = array(
'#theme' => $this
->themeFunctions(),
'#view' => $this->view,
'#options' => $this->options,
'#row' => $item,
);
return $build;
}
}