You are here

function feed_import_element_validate_simplexmlclass in Feed Import 7.3

Same name and namespace in other branches
  1. 8 feed_import.module \feed_import_element_validate_simplexmlclass()

Validates class name to be instance of SimpleXMLElement

1 string reference to 'feed_import_element_validate_simplexmlclass'
feed_import_feed_import_reader_info in ./feed_import.module
Implements hook_feed_import_reader_info().

File

./feed_import.module, line 2762
User interface, cron functions for feed_import module

Code

function feed_import_element_validate_simplexmlclass($element, &$form_state, $form) {
  if (!$element['#value']) {
    return;
  }
  if ($element['#value'] != 'SimpleXMLElement' && !is_subclass_of($element['#value'], 'SimpleXMLElement')) {
    form_error($element, t('%title must extend SimpleXMLElement class!', array(
      '%title' => $element['#title'],
    )));
  }
}