You are here

class FeedsElement in Feeds 6

Same name and namespace in other branches
  1. 7.2 plugins/FeedsParser.inc \FeedsElement
  2. 7 plugins/FeedsParser.inc \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.

Hierarchy

Expanded class hierarchy of FeedsElement

See also

FeedsEnclosure

File

plugins/FeedsParser.inc, line 110

View source
class FeedsElement {

  // The standard value of this element. This value can contain be a simple type,
  // a FeedsElement or an array of either.
  protected $value;

  /**
   * Constructor.
   */
  public function __construct($value) {
    $this->value = $value;
  }

  /**
   * @todo Make value public and deprecate use of getValue().
   *
   * @return
   *   Standard value of this FeedsElement.
   */
  public function getValue() {
    return $this->value;
  }

  /**
   * @return
   *   A string representation of this element.
   */
  public function __toString() {
    if (is_array($this->value)) {
      return 'Array';
    }
    if (is_object($this->value)) {
      return 'Object';
    }
    return (string) $this
      ->getValue();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsElement::$value protected property
FeedsElement::getValue public function @todo Make value public and deprecate use of getValue(). 3
FeedsElement::__construct public function Constructor. 3
FeedsElement::__toString public function 1