Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions().
Overrides DerivativeInterface::getDerivativeDefinitions
public function getDerivativeDefinitions(array $base_plugin_definition) {
// Add a block plugin definition for each feed.
$result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid');
foreach ($result as $feed) {
$this->derivatives[$feed->fid] = $base_plugin_definition;
$this->derivatives[$feed->fid]['delta'] = $feed->fid;
$this->derivatives[$feed->fid]['admin_label'] = t('@title feed latest items', array(
'@title' => $feed->title,
));
}
return $this->derivatives;
}