You are here

protected function FeedsSimplePieParser::createTitle in Feeds 8.2

Generate a title from a random text.

1 call to FeedsSimplePieParser::createTitle()
FeedsSimplePieParser::parse in lib/Drupal/feeds/Plugin/feeds/parser/FeedsSimplePieParser.php
Implements FeedsParser::parse().

File

lib/Drupal/feeds/Plugin/feeds/parser/FeedsSimplePieParser.php, line 195
Contains FeedsSimplePieParser and related classes.

Class

FeedsSimplePieParser
Defines a CSV feed parser.

Namespace

Drupal\feeds\Plugin\feeds\parser

Code

protected function createTitle($text = FALSE) {

  // Explode to words and use the first 3 words.
  $words = preg_split("/[\\s,]+/", $text);
  $words = array_slice($words, 0, 3);
  return implode(' ', $words);
}