Source

trekel / src / php / Trekel / Node / Attribute.php

Full commit
<?php

abstract class Trekel_Node_Attribute extends Trekel_Node {

  protected $attributeValue = null;
  protected $attributeId = null;

  public function getValue () {
    return $this->attributeValue;
  }

  public function setValue ($value) {
    $this->attributeValue = $value;
  }

  public function setIdentifier ($id) {
    $this->attributeId = $id;
  }

  public function getIdentifier () {
    return $this->attributeId;
  }

  protected function getData ($node) {
    if (substr($this->attributeId, -2) == "()") {
      $method = substr($this->attributeId, 0, -2);
      return $node->$method();
    } else {
      return $node->{$this->attributeId};
    }
  }

}