public function __get($key) { $node = reset($this->collection); if ($node instanceof AbstractNode) { return $node->{$key}; } else { throw new EmptyCollectionException('The collection does not contain any Nodes.'); } }