Skip to content
Browse files

Add a self method to the SSViewer scope.

This returns the current object, and resets the scope.
  • Loading branch information...
1 parent 14a56c1 commit a4096ecc700914178655d2f76fbeb0a09e4d49a4 @ajshort ajshort committed
Showing with 13 additions and 1 deletion.
  1. +13 −1 view/SSViewer.php
View
14 view/SSViewer.php
@@ -96,7 +96,19 @@ public function obj($name, $arguments = null, $forceReturnedObject = true, $cach
$this->upIndex, $this->currentIndex);
return $this;
}
-
+
+ /**
+ * Gets the current object and resets the scope.
+ *
+ * @return object
+ */
+ public function self() {
+ $result = $this->itemIterator ? $this->itemIterator->current() : $this->item;
+ $this->resetLocalScope();
+
+ return $result;
+ }
+
public function pushScope(){
$newLocalIndex = count($this->itemStack)-1;

0 comments on commit a4096ec

Please sign in to comment.
Something went wrong with that request. Please try again.