You are here

public function FeedsElement::__toString in Feeds 8.2

Magic method __toString() for printing and string conversion of this object.

Return value

A string representation of this element.

File

lib/Drupal/feeds/FeedsElement.php, line 40

Class

FeedsElement
Defines an element of a parsed result. Such an element can be a simple type, a complex type (derived from FeedsElement) or an array of either.

Namespace

Drupal\feeds

Code

public function __toString() {
  if (is_array($this->value)) {
    return 'Array';
  }
  if (is_object($this->value)) {
    return 'Object';
  }
  return (string) $this
    ->getValue();
}