Getter for history.

@author Benjamin Carl <opensource@clickalicious.de>
@return string The value if set, otherwise NULL
@access protected
8942
protected function getHistory($key = null)
    {
        return (true === isset($this->history[$key])) ? $this->history[$key] : null;
    }
986642
def get_history(self):
        """"""
        self.load_history()
        return map(lambda x: (x, self.history[x]), self.ordered_history)
857074
public Record getHistoryRecord()
    {
        if (m_recDependent == null)
        {
            if (m_strRecHistoryClass != null)
            {
                m_recDependent = Record.makeRecordFromClassName(m_strRecHistoryClass, Record.findRecordOwner(this.getOwner()));
                if (m_recDependent != null)
                {
                    m_bCloseOnFree = true;
                    m_recDependent.addListener(new FileRemoveBOnCloseHandler(this));    // Being careful
                    if (m_recDependent.getListener(RecordChangedHandler.class) != null)
                        m_recDependent.removeListener(this.getOwner().getListener(RecordChangedHandler.class), true);  // I replace this listener
                }                    
            }
        }
        return m_recDependent;
    }
16482
public function getCurrent()
    {
        if ($this->current === null) {
            $this->current = false;

            $item = $this->getFromSession();
            if (!$item) {
                $item = $this->getFromCookie();
            }

            if ($item && $this->checkAccessCurrent($item)) {
                $this->beforeSetCurrent($item);
                $this->setAndSaveCurrent($item);
            } else {
                $this->setCurrent($this->getCurrentDefault());
            }
        }

        return $this->current;
    }
88873
public function current()
    {
        if ($this->current instanceof TerminalBucket) {
            return null;
        }

        /** @var KeyValueBucket $current */
        $current = $this->current;

        return $current->value();
    }
452150
protected function getPrev()
    {
        if (!$this->current)
        {
            return null;
        }
        if ($this->prev !== -1)
        {
            return $this->prev;
        }
        $this->load();
        for ($i = 0; $i < count($this->items); $i++)
        {
            if ($this->items[$i]->id == $this->current->id)
            {
                if ($i > 0)
                {
                    $this->prev = $this->items[$i - 1];
                    return $this->prev;
                }
                break;
            }
        }
        return null;
    }
269087
public function last()
    {
        $lastIndex = (count($this->source) - 1);
        if (isset($this->source[$lastIndex])) {
            return $this->source[$lastIndex];
        }

        return null;
    }
1372699
public function getValue() {
    if (gettype($this->value) !== 'object') {
      return parent::getValue();
    }

    $value = clone($this->value);
    $set_props = $this->getSetProps();

    // Adds properties to value.
    foreach ($set_props as $set_prop) {
      if ($value->{$set_prop} instanceof Atom) {
        $value->{$set_prop} = $value->{$set_prop}->getValue();
      }
    }

    return $value;
  }
279737
function getHistory(context) {
  if (!historyMap.has(context)) {
    clear(context);
  }
  return historyMap.get(context);
}
1308194
public function getValueAttribute()
    {
        if (!isset($this->cachedValue)) {
            $this->cachedValue = $this->getDataTypeRegistry()
                ->getHandlerForType($this->type)
                ->unserializeValue($this->attributes['value']);
        }

        return $this->cachedValue;
    }
1330774
public function GetArticleViewHistory()
    {
        if (is_null($this->aArticleViewHistory)) {
            $this->aArticleViewHistory = array();
            $iMaxQueueLength = 100;
            $shop = $this->getShopService()->getActiveShop();
            if ($shop->fieldDataExtranetUserShopArticleHistoryMaxArticleCount < $iMaxQueueLength && $shop->fieldDataExtranetUserShopArticleHistoryMaxArticleCount > 0) {
                $iMaxQueueLength = $shop->fieldDataExtranetUserShopArticleHistoryMaxArticleCount;
            }

            if ($this->IsLoggedIn()) {
                // fetch from user
                $iNumRecsAdded = 0;
                $oHistoryList = &$this->GetFieldDataExtranetUserShopArticleHistoryList();
                while (($oHistoryItem = $oHistoryList->Next()) && $iNumRecsAdded <= $iMaxQueueLength) {
                    $this->aArticleViewHistory[] = $oHistoryItem->sqlData;
                }
            } else {
                // fetch from cookie
                $aTmpHist = null;
                if (array_key_exists(TdbDataExtranetUser::COOKIE_NAME_HISTORY, $_COOKIE)) {
                    $sHistory = base64_decode($_COOKIE[TdbDataExtranetUser::COOKIE_NAME_HISTORY]);
                    $aTmpHist = json_decode($sHistory, true);
                }
                if (is_array($aTmpHist)) {
                    reset($aTmpHist);
                    foreach ($aTmpHist as $iKey => $aHistItemData) {
                        $oHistoryItem = TdbDataExtranetUserShopArticleHistory::GetNewInstance();
                        $oHistoryItem->LoadFromRow($aHistItemData);
                        $this->aArticleViewHistory[] = $oHistoryItem->sqlData;
                    }
                }
            }
        }

        $historyList = array();
        foreach ($this->aArticleViewHistory as $item) {
            $historyList[] = TdbDataExtranetUserShopArticleHistory::GetNewInstance($item);
        }

        return $historyList;
    }
675693
public function prev()
    {
        $value = prev($this->_data);
        return key($this->_data) !== null ? $value : null;
    }
1122878
public function get_value() {
		if ( $this->group && null === $this->value ) {
			return $this->value = $this->get_value_in_group();
		}

		return $this->value;
	}
43225
public function getIterator()
    {
        // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll())
        return new \ArrayIterator(array_map(function ($entry) {
            $entry['request']->getParams()->set('actual_response', $entry['response']);
            return $entry['request'];
        }, $this->transactions));
    }
703897
public function getPrev()
    {
        end($this->groups);
        while ($key = key($this->groups)) {
            $prevGroup = prev($this->groups);

            if ($this->groups[$key] === $this->group && $prevGroup) {
                return $prevGroup;
            }
        }

        return $this->group;
    }
1168302
public static function history(History $history)
    {
        return function (callable $handler) use ($history) {
            return function (
                CommandInterface $command,
                RequestInterface $request = null
            ) use ($handler, $history) {
                $ticket = $history->start($command, $request);
                return $handler($command, $request)
                    ->then(
                        function ($result) use ($history, $ticket) {
                            $history->finish($ticket, $result);
                            return $result;
                        },
                        function ($reason) use ($history, $ticket) {
                            $history->finish($ticket, $reason);
                            return Promise\rejection_for($reason);
                        }
                    );
            };
        };
    }
190577
private function PreviousItem()
    {
        $this->previous = $this->GetTreeItem('previous');
        return $this->previous->Exists() ? $this->previous : null;
    }