You are here

protected function FeedsNodeProcessor::entityValidate in Feeds 8.2

Validates a node.

Overrides FeedsProcessor::entityValidate

File

lib/Drupal/feeds/Plugin/feeds/processor/FeedsNodeProcessor.php, line 135
Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsNodeProcessor.

Class

FeedsNodeProcessor
Defines a node processor.

Namespace

Drupal\feeds\Plugin\feeds\processor

Code

protected function entityValidate($entity) {
  if (!isset($entity->uid) || !is_numeric($entity->uid)) {
    $entity->uid = $this->config['author'];
  }
  if (drupal_strlen($entity->title) > 255) {
    $entity->title = drupal_substr($entity->title, 0, 255);
  }
}