Add a self method to the SSViewer scope.

This returns the current object, and resets the scope.
This commit is contained in:
ajshort 2013-02-11 17:53:14 +11:00
parent 14a56c18e9
commit a4096ecc70

View File

@ -97,6 +97,18 @@ class SSViewer_Scope {
return $this; 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(){ public function pushScope(){
$newLocalIndex = count($this->itemStack)-1; $newLocalIndex = count($this->itemStack)-1;