Retrieve a history item

@param string $sNamespace The event namespace
@param string $sEvent     The event name

@return array|\stdClass|null
969996
public function getHistory($sNamespace = null, $sEvent = null)
    {
        $sEvent     = strtoupper($sEvent);
        $sNamespace = strtoupper($sNamespace);

        if (empty($sNamespace) && empty($sEvent)) {
            return $this->aHistory;
        } elseif (
            empty($sEvent) &&
            !empty($sNamespace) &&
            array_key_exists($sNamespace, $this->aHistory)
        ) {
            return $this->aHistory[$sNamespace];
        } elseif (
            !empty($sNamespace) &&
            array_key_exists($sNamespace, $this->aHistory) &&
            !empty($sEvent) &&
            array_key_exists($sEvent, $this->aHistory[$sNamespace])
        ) {
            return $this->aHistory[$sNamespace][$sEvent];
        }

        return null;
    }
9625
public function ns($namespace, $defaultTTL = null)
    {
        $namespace = $this->id($namespace);
        $defaultTTL = $defaultTTL ?: $this->defaultTTL;
        return new Cache($this->backend, $namespace, $defaultTTL, $this->ttlVariation);
    }
795241
public function HasNamespace($namespace, $header="")
    {
        if($header)
        {
            if(isset($this->headers[$header]->namespaces[$namespace]))
            {
                return $this->headers[$header]->namespaces[$namespace];
            }
        }
        else
        {
            foreach($this->headers as $header_object)
            {
                if(isset($header_object->namespaces[$namespace]))
                {
                    return $header_object->namespaces[$namespace];
                }
            }
        }
        
        return null;
    }
913339
final public function get($varname, $namespace = 'default')
    {
        //gets a registry var, stored in a namespace of this session id
        $session = $this;

        if (!isset($namespace) || empty($namespace)) {
            //@TODO Throw an exception, we need a name or use the default;
            return false;
        }

        //@TODO, check if the regitry is not locked before adding
        $registry = $session->getNamespace($namespace);

        return $registry->get($varname);
    }
615671
public static function getClassesInNamespace($strNamespace)
    {
        $arrOptions = [];

        foreach (array_keys(ClassLoader::getClasses()) as $strName)
        {
            if (StringUtil::startsWith($strName, $strNamespace))
            {
                $arrOptions[$strName] = $strName;
            }
        }

        asort($arrOptions);

        return $arrOptions;
    }
624934
protected static function getAdapterName($name, $namespace = "TeamSpeak3_Adapter_")
  {
    $path = self::getFilePath($namespace);
    $scan = scandir($path);

    foreach($scan as $node)
    {
      $file = TeamSpeak3_Helper_String::factory($node)->toLower();

      if($file->startsWith($name) && $file->endsWith(".php"))
      {
        return $namespace . str_replace(".php", "", $node);
      }
    }

    throw new TeamSpeak3_Adapter_Exception("adapter '" . $name . "' does not exist");
  }
407175
public function getTemplatePath($namespace = null)
    {
        if (null !== $namespace && ! is_string($namespace)) {
            throw new Exception\InvalidNamespaceException('Namespace must be a string');
        }

        $namespace = $namespace ?: self::DEFAULT_NAMESPACE;

        if (! array_key_exists($namespace, $this->paths)) {
            $this->paths[$namespace] = new SplStack;
        }

        return $this->paths[$namespace];
    }
1145641
public static function getNamespace($tokens)
    {
        $count = count($tokens);
        $i = 0;
        $namespace = '';
        $namespace_ok = false;
        while ($i < $count) {
            $token = $tokens[$i];
            if (is_array($token) && $token[0] === T_NAMESPACE) {
                // Found namespace declaration
                while (++$i < $count) {
                    if ($tokens[$i] === ';') {
                        $namespace_ok = true;
                        $namespace = trim($namespace);
                        break;
                    }
                    $namespace .= is_array($tokens[$i]) ? $tokens[$i][1] : $tokens[$i];
                }
                break;
            }
            $i++;
        }
        if (!$namespace_ok) {
            return null;
        } else {
            return $namespace;
        }
    }
813015
protected function _callEvent($sEvent, $sModuleId)
    {
        $aModuleEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');

        if (isset($aModuleEvents[$sModuleId], $aModuleEvents[$sModuleId][$sEvent])) {
            $mEvent = $aModuleEvents[$sModuleId][$sEvent];

            if (is_callable($mEvent)) {
                call_user_func($mEvent);
            }
        }
    }
361761
public function retrieve($key, $timestamp = false) {
    $cachedData = $this->_loadCache();
    (false === $timestamp) ? $type = 'data' : $type = 'time';
    if (!isset($cachedData[$key][$type])) return null; 
    return unserialize($cachedData[$key][$type]);
  }
126562
public function getAttachedContentElements($newsRecord)
    {
        $queryBuilder = Db::getQueryBuilder('tt_content');
        $res = $queryBuilder
            ->select('*')
            ->from('tt_content')
            ->where(
                $queryBuilder->expr()->eq(
                    'tx_news_related_news',
                    $queryBuilder->createNamedParameter($newsRecord['uid'], \PDO::PARAM_INT)
                )
            )
            ->execute();

        $contentElements = array();
        if ($res->rowCount()) {
            while (($contentElement = $res->fetch())) {
                $contentElements[] = $contentElement;
            }
        }

        return $contentElements;
    }
497406
public function getNamespaceByName( $name ) {
		$result = $this->getNamespaceResult()['query'];
		foreach ( $result['namespaces'] as $nsInfo ) {
			if ( ( !empty( $nsInfo['canonical'] ) && $nsInfo['canonical'] === $name ) ||
				$nsInfo['*'] === $name ) {
				return $this->createNamespaceFromQuery( $nsInfo, $result['namespacealiases'] );
			}
		}
		foreach ( $result['namespacealiases'] as $alias ) {
			if ( $alias['*'] === $name && !empty( $result['namespaces'][$alias['id']] ) ) {
				return $this->createNamespaceFromQuery(
					$result['namespaces'][$alias['id']],
					$result['namespacealiases']
				);
			}
		}
		return null;
	}
201529
private function getOptionsFromNamespace($sClassName, $sNamespace = null)
    {
        // Find the corresponding namespace
        if($sNamespace === null)
        {
            foreach(array_keys($this->aNamespaceOptions) as $_sNamespace)
            {
                if(substr($sClassName, 0, strlen($_sNamespace) + 1) == $_sNamespace . '\\')
                {
                    $sNamespace = $_sNamespace;
                    break;
                }
            }
        }
        if($sNamespace === null)
        {
            return null; // Class not registered
        }

        // Get the class options
        $aOptions = $this->aNamespaceOptions[$sNamespace];
        $aDefaultOptions = []; // ['namespace' => $aOptions['namespace']];
        if(key_exists('separator', $aOptions))
        {
            $aDefaultOptions['separator'] = $aOptions['separator'];
        }
        return $this->getClassOptions($sClassName, $aOptions, $aDefaultOptions);
    }
685495
def namedb_get_namespace_by_preorder_hash( cur, preorder_hash, include_history=True ):
    

    select_query = "SELECT * FROM namespaces WHERE preorder_hash = ?;"
    namespace_rows = namedb_query_execute( cur, select_query, (preorder_hash,))

    namespace_row = namespace_rows.fetchone()
    if namespace_row is None:
        # no such namespace 
        return None 

    namespace = {}
    namespace.update( namespace_row )

    if include_history:
        hist = namedb_get_history( cur, namespace['namespace_id'] )
        namespace['history'] = hist

    namespace = op_decanonicalize(op_get_opcode_name(namespace['op']), namespace)
    return namespace
633852
public function trigger($sEvent, $sNamespace = 'nails/common', $aData = [])
    {
        $this->addHistory($sEvent, $sNamespace);

        $sEvent     = strtoupper($sEvent);
        $sNamespace = strtoupper($sNamespace);

        if (!empty($this->aSubscriptions[$sNamespace][$sEvent])) {
            foreach ($this->aSubscriptions[$sNamespace][$sEvent] as $sSubscriptionHash => $oSubscription) {
                if (is_callable($oSubscription->callback)) {
                    call_user_func_array($oSubscription->callback, $aData);
                }

                if ($oSubscription->is_once) {
                    unset($this->aSubscriptions[$sNamespace][$sEvent][$sSubscriptionHash]);
                }
            }
        }

        return $this;
    }
994817
public function getContent(string $namespace, string $locale, string $name): string
    {
        $nKey = self::getNKey($namespace, $locale);

        // L1 read
        $content = $this->loadedData[$nKey][$name] ?? false;

        if (is_string($content)) {
            // L1 hit
            return $content;
        }

        // L2 read + L1 write
        $this->loadedData[$nKey] = $this->loadedData[$nKey] ?? $this->loadNspaceFromCache($namespace, $locale);

        $fallbackLocale = $this->config['fallback'] ?? '';
        $content = $this->loadedData[$nKey][$name] ?? false;

        if (is_string($content)) {
            return $content;
        }

        if ($fallbackLocale === false || $locale === $fallbackLocale) {
            return '';
        }

        return $this->getContent($namespace, $fallbackLocale, $name);
    }
472180
def get_namespace( self, namespace_id, include_history=True ):
        

        cur = self.db.cursor()
        return namedb_get_namespace_ready( cur, namespace_id, include_history=include_history )