Obtiene una variable de la sesion.

@param string $llave
@param mixed $valorAlterno
@return mixed
13649
public function obtener($llave, $valorAlterno = null)
    {
        $this->requerirInicio();

        return isset($this->datos[$llave]) ? $this->datos[$llave] : $valorAlterno;
    }
102094
protected function configureValueResolver(BaseValueResolver $valueResolver, $dn = null)
    {
        if ($this->connection) {
            $valueResolver->setLdapConnection($this->connection);
        }
        if (!is_null($dn)) {
            $valueResolver->setDn($dn);
        }
    }
942328
function urlFor($internalUri, $locale = NULL){
        $internalUri= ltrim($internalUri, '/');
        if($locale == NULL)return $this->request->realBaseUrl . $internalUri;
        else return $this->request->realBaseUrl . $locale . '/' . $internalUri;
    }
1183145
public function set(string $variableName = null, $variableValue = null, array $expires = ['m' => 1],
                        bool $encrypted = true): Cookie
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }

        \setcookie(
            $variableName,
            $encrypted === true ? $variableValue : $variableValue,
            $this->getExpireTime($expires),
            $this->getPath(),
            $this->getDomain(),
            $this->isSecure(),
            $this->isHttpOnly()
        );
        $this->variables[$variableName] = $variableValue;

        return static::$instance;
    }
188227
public function ifle($sValue1, $sValue2)
    {
        $this->sCondition = '(' . Parameter::make($sValue1) . '<=' . Parameter::make($sValue2) . ')';
        return $this;
    }
170204
public function parseLiteral($valueNode, array $variables = null): EntityID
    {
        $value = (string) parent::parseLiteral($valueNode);

        return $this->createEntityID($value);
    }
860760
public function toQuery( $variableSet, $factVariableBinding )
	{
		$clauses = array();

		$dimensionClause = "";
		if ( $this->dimension )
		{
			// $qname = qname( $this->dimension );
			$dimensionClause = "fn:QName('{$this->dimension['namespace']}','{$this->dimension['name']}')";
		}
		else if ( $this->dimensionExpression )
		{
			$dimensionClause = $this->dimensionExpression;
		}
		else
		{
			return "false()";
		}

		if ( ! $this->members )
		{
			return "xfi:fact-has-explicit-dimension(.,$dimensionClause)";
		}

		foreach ( $this->members as $member )
		{
			$memberClause = "";
			if ( isset( $member['qname'] ) )
			{
				// $qname = qname( $member['qname'] );
				$memberClause = "fn:QName('{$member['qname']['namespace']}','{$member['qname']['name']}')";
			}
			else if ( isset( $member['qnameExpression'] ) )
			{
				$memberClause = $member['qnameExpression'];
			}
			elseif ( isset( $member['variable'] ) )
			{
				// $memberClause = "fn:QName('{$member['variable']['namespace']}','{$member['variable']['name']}')";
				// TODO Can the QName resulting from this query be determined once for this set of aspect facts?
				//      If the implied variable can depend on other variables that are linked to the current fact
				//      then the QName cannot be determined upfront.  However it formula rule prohibit such a
				//      relationship then it can.
				//      For now assume the worst case and have the clause evaluated for every fact
				$variable = $member['variable']['originalPrefix']
					? "\${$member['variable']['originalPrefix']}:{$member['variable']['name']}"
					: "\${$member['variable']['name']}";

				// $variable is 'the current fact'
				$memberClause = "xfi:fact-explicit-dimension-value( $variable, $dimensionClause )";
			}
			else
			{
				continue;
			}

			// Dimensions filter spec 2.1 states:
			// If a filter member does not contain a filter-member linkrole, arcrole and axis, then the only
			// domain member in its filter-member set is the domain member identified by the filter-member value.
			if ( ! isset( $member['arcrole'] ) || ! isset( $member['axis'] ) || ! isset( $member['linkrole'] ) )
			{
				if ( isset( $member['axis'] ) && in_array( $member['axis'], array( 'DRS-child', 'DRS-descendant' ) ) )
				{
					$axis = isset( $member['axis'] ) ? $member['axis'] : "";
					$linkrole = isset( $member['linkrole'] ) ? $member['linkrole'] : "";
					$xpath = "( if (xfi:fact-has-explicit-dimension(.,$dimensionClause)) then " .
							 "( some \$member in xfi:filter-member-DRS-selection($dimensionClause,fn:node-name(.),$memberClause,'$linkrole','$axis') satisfies (xfi:fact-explicit-dimension-value(.,$dimensionClause) eq \$member) )" .
							 " else fn:false() )";
					$clauses[] = $xpath;
				}
				else
				{
					$clauses[] = "xfi:fact-has-explicit-dimension-value(.,$dimensionClause,$memberClause)";
				}
			}
			else
			{
				$arcrole = isset( $member['arcrole'] ) ? $member['arcrole'] : "";
				$axis = isset( $member['axis'] ) ? $member['axis'] : "";
				$linkrole = isset( $member['linkrole'] ) ? $member['linkrole'] : "";

				// TODO This needs optimizing otherwise the whole expression is evaluated for every fact element.
				$xpath = "( if (xfi:fact-has-explicit-dimension(.,$dimensionClause)) then " .
						 "( some \$member in xfi:filter-member-network-selection($dimensionClause,$memberClause,'$linkrole','$arcrole','$axis') satisfies (xfi:fact-explicit-dimension-value(.,$dimensionClause) eq \$member) )" .
						 " else fn:false() )";
				$clauses[] = $xpath;
			}
		}

		return implode( " or ", $clauses );

	}
828722
public static function get($name, $altValue = null) {
        $page = self::me();

        if (\key_exists($name, $page->properties))
            return $page->properties[$name];

        return $altValue;
    }
729099
public function get($key, $localOnly = false)
    {
        $cacheKey = $this->cacheKey($key);

        if($this->keepLocalCache && array_key_exists($cacheKey, $this->localCache))
            return $this->localCache[$cacheKey];

        if(!$localOnly){
            $value = $this->cacheStore->get($cacheKey);
            if($this->keepLocalCache && $value !== false)
                $this->localCache[$cacheKey] = $value;
            return $value;
        }

        return false;
    }
1254983
public function findByLocaleAndInternalItemNumber($locale, $internalItemNumber)
    {
        $products = $this->productRepository->findByLocaleAndInternalItemNumber(
            $locale,
            $internalItemNumber
        );
        if ($products) {
            array_walk(
                $products,
                function (&$product) use ($locale) {
                    $product = $this->productFactory->createApiEntity($product, $locale);
                }
            );
        }

        return $products;
    }
502780
public function writeVariableValue(Variable $variable, $valueType = self::RW_VALUE)
    {
        switch ($valueType) {
            case self::RW_DEFAULTVALUE:
                $getterToCall = 'getDefaultValue';
                break;
                
            case self::RW_CORRECTRESPONSE:
                $getterToCall = 'getCorrectResponse';
                break;
                
            default:
                $getterToCall = 'getValue';
        }
        
        try {
            $value = call_user_func(array($variable, $getterToCall));
            $cardinality = $variable->getCardinality();
            $baseType = $variable->getBaseType();

            if (is_null($value) === true) {
                $this->writeBoolean(true);

                return;
            }

            // Non-null value.
            $this->writeBoolean(false);

            if ($cardinality === Cardinality::RECORD) {
                // is-scalar
                $this->writeBoolean(false);

                // count
                $this->writeShort(count($value));

                // content
                foreach ($value as $k => $v) {
                    $this->writeRecordField(array($k, $v), is_null($v));
                }
            } else {
                $toCall = 'write' . ucfirst(BaseType::getNameByConstant($baseType));

                if ($cardinality === Cardinality::SINGLE) {
                    // is-scalar
                    $this->writeBoolean(true);

                    // content
                    $this->$toCall(($value instanceof QtiScalar) ? $value->getValue() : $value);
                } else {
                    // is-scalar
                    $this->writeBoolean(false);

                    // count
                    $this->writeShort(count($value));

                    // MULTIPLE or ORDERED
                    foreach ($value as $v) {
                        if (is_null($v) === false) {
                            $this->writeBoolean(false);
                            $this->$toCall(($v instanceof QtiScalar) ? $v->getValue() : $v);
                        } else {
                            $this->writeBoolean(true);
                        }
                    }
                }
            }
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing a Variable value.";
            throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::VARIABLE, $e);
        }
    }
1191197
public function setLocLat($varValue, \DataContainer $dc)
    {
        if ($varValue != 0)
        {
            if (!Utils::validateLat($varValue))
            {
                throw new \Exception($GLOBALS['TL_LANG']['c4g_maps']['geoy_invalid']);
            }
        }
        return $varValue;
    }
841681
public function findCanonical(string $locale): ?Scope
    {
        $canonicals = $this->config->get('canonicals');

        if (!isset($canonicals[$locale])) {
            return null;
        }

        $scope = $this->findByRoot($canonicals[$locale]);

        return $scope->setCustomRoot(Root::fromString($canonicals[$locale]));
    }
1247084
protected function opAnd($left, $right, $shouldEval)
    {
        if (! $shouldEval) {
            return null;
        }

        if ($left !== static::$false and $left !== static::$null) {
            return $this->reduce($right, true);
        }

        return $left;
    }
363257
public static function factory($xValue = null, $yValue = null)
    {
        $dataPoint = new self();

        $dataPoint
            ->setXValue($xValue)
            ->setYValue($yValue);

        return $dataPoint;
    }
262808
public function existe($llave)
    {
        $this->gestor->get($llave);
        if ($this->gestor->getResultCode() == \Memcached::RES_NOTFOUND) {
            return false;
        } else {
            return true;
        }
    }
1247566
private function compareVariant(MatchedPreferenceInterface $lValue, MatchedPreferenceInterface $rValue)
    {
        return strcasecmp($lValue->getVariant(), $rValue->getVariant());
    }