Drupal 8  8.0.2
OpmlFeedAdd Class Reference
Inheritance diagram for OpmlFeedAdd:

Public Member Functions

 __construct (FeedStorageInterface $feed_storage, ClientInterface $http_client)
 getFormId ()
 buildForm (array $form, FormStateInterface $form_state)
 validateForm (array &$form, FormStateInterface $form_state)
 submitForm (array &$form, FormStateInterface $form_state)

Static Public Member Functions

static create (ContainerInterface $container)

Protected Member Functions

 parseOpml ($opml)

Protected Attributes


Detailed Description

Imports feeds from OPML.

Constructor & Destructor Documentation

__construct ( FeedStorageInterface  $feed_storage,
ClientInterface  $http_client 

Constructs a database object.

\Drupal\aggregator\FeedStorageInterface$feed_storageThe feed storage.
\GuzzleHttp\ClientInterface$http_clientThe Guzzle HTTP client.

References Drupal\httpClient().

Here is the call graph for this function:

Member Function Documentation

buildForm ( array  $form,
FormStateInterface  $form_state 


References Drupal\service(), t(), and Drupal\url().

Here is the call graph for this function:

static create ( ContainerInterface  $container)


getFormId ( )


parseOpml (   $opml)

Parses an OPML file.

Feeds are recognized as <outline> elements with the attributes "text" and "xmlurl" set.

string$opmlThe complete contents of an OPML document.
array An array of feeds, each an associative array with a "title" and a "url" element, or NULL if the OPML document failed to be parsed. An empty array will be returned if the document is valid but contains no feeds, as some OPML documents do.
Move this to a parser in https://www.drupal.org/node/1963540.

References drupal_xml_parser_create().

Referenced by OpmlFeedAdd\submitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

submitForm ( array &  $form,
FormStateInterface  $form_state 


References Drupal\httpClient(), UrlHelper\isValid(), Drupal\logger(), OpmlFeedAdd\parseOpml(), and t().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 


References t().

Here is the call graph for this function:

The documentation for this class was generated from the following file: