+ $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', $this->getStackCount($stackerName) - 1);
+
+ // Return it
+ return $value;
+ }
+
+ /**
+ * Get first value from named stacker
+ *
+ * @param $stackerName Name of the stack
+ * @return $value Value of last added value
+ * @throws NoStackerException If the named stacker was not found
+ * @throws EmptyStackerException If the named stacker is empty
+ */
+ protected function getFirstValue ($stackerName) {
+ // Is the stack not yet initialized or full?
+ if (!$this->isStackInitialized($stackerName)) {
+ // Throw an exception
+ throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+ } elseif ($this->isStackEmpty($stackerName)) {
+ // Throw an exception
+ throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+ }
+
+ // Now get the first value
+ $value = $this->getGenericArrayElement('stacks', $stackerName, 'entries', 0);