Get value for a key.

@param string $key Counter key.
@param \DatePeriod $period Date period.
@return \Krucas\Counter\Contracts\Value|array
168297
public function get($key, \DatePeriod $period = null)
    {
        if (is_null($period)) {
            return new Value($this->repository->get($key));
        }

        return $this->getForPeriod($key, $period);
    }
997641
public function get($key)
	{
		if ($value = $this->memcache->get($this->prefix.$key)) {
		    return $value;
		}
	}
503513
public function get($key)
    {
        if (isset($this->cache[$key])) {
            list($expires, $value) = $this->cache[$key];
            if (!$expires || ($expires >= microtime(true))) {
                return $value;
            }
            unset($this->cache[$key]);
        }
        return false;
    }
1110313
private function processPeriod($period)
    {
        $sub = null;

        if ($period == 'week' || $period == 'W') {
            $sub = \Zend_Date::WEEK;
        } elseif ($period == 'month' || $period == 'M') {
            $sub = \Zend_Date::MONTH;
        } elseif ($period == 'year') {
            $sub = \Zend_Date::YEAR;
        } elseif ($period == 'D') {
            $sub = \Zend_Date::DAY;
        }
        return $sub;
    }
585317
protected function decrementForPeriod($key, $value, \DatePeriod $period)
    {
        $ranges = $this->getRanges($period);

        if (count($ranges) > 0) {
            foreach ($ranges as $range) {
                $range instanceof DateRange
                    ? $this->repository->decrementForRange($key, $range->getStartDate(), $range->getEndDate(), $value)
                    : $this->repository->decrementFor($key, $range, $value);
            }
        }
    }
456812
static public function getPersistentVariable( $key = null )
    {
        if ( $key !== null )
        {
            if ( isset( self::$persistentVariable[ $key ] ) )
                return self::$persistentVariable[ $key ];
            return null;
        }
        return self::$persistentVariable;
    }
632110
protected function getRanges(\DatePeriod $period)
    {
        $ranges = array();

        $start = null;
        $end = null;
        $single = true;

        foreach ($period as $i => $date) {
            // Set single date
            $ranges[$i] = $date;

            // This is interval, so set it.
            if ($i > 0) {
                $ranges[$i - 1] = new DateRange($ranges[$i - 1], $date);
                $single = false;
            }
        }

        // Ranges are stored, so we don't need las element
        if (!$single) {
            array_pop($ranges);
        }

        return $ranges;
    }
1002567
public function get($key)
    {
        $value = $this->apc->get($this->prefix.$key);

        if ($value !== false) {
            return $value;
        }
    }
195196
private function getPeriodAspectValue( $source, $evaluationResult, $log )
	{
		// Get the period name from the source
		if ( is_null( $this->periodRule ) )
		{
			$context = $this->getContextForSource( $source, $evaluationResult, ASPECT_PERIOD, $log, $contextRef );
			if ( ! $context || ! isset( $context['period'] ) ) return null;

			// TODO What is in the $context array
			return $context['period'];
		}
		else
		{
			/**
			 *
			 * @var Period $period
			 */
			$period = Period::fromArray( $this->periodRule );
			// This function will throw an exception if there is a problem so there is no return value to check
			$this->checkSAVConflicts( $period->source, ASPECT_PERIOD, $evaluationResult, $log );
			return $period->getValue( $this, $evaluationResult, $log );
		}
	}
1328211
public function sameValueAs(Period $period)
	    {
	        return $this->start == $period->start && $this->end == $period->end;
	    }
684381
public function getValue($key){
		$this->loadCurrent();
		
		return $this->translator->getValue($this->current, $this->document, $key);
	}
246641
public function get($key)
    {
        $key       = (string)$key;
        $value     = null;
        $this->hit = false;

        if (\array_key_exists($key, self::$registry)) {
            if (self::$registry[$key]['expires'] >= (new DateTime())) {
                $this->hit = true;
                return $this->restoreDataStructure($key);
            }
            unset(self::$registry[$key]);
        }

        return $value;
    }
598394
public static function prevPeriod($period, $year, $number)
    {
        if ($number > 1) {
            return array('year' => $year, 'number' => ($number - 1));
        } else {
            $maxPeriod = 12 / $period;

            return array('year' => ($year - 1), 'number' => $maxPeriod);
        }
    }
1364477
public function getExpForPeriod()
    {
        $value = 'SUBSTR(`' . self::AS_BON_BASE_PERIOD . '`.`' . EPeriod::A_DSTAMP_BEGIN . '`, 1, 6)';
        $result = new \Praxigento\Core\App\Repo\Query\Expression($value);
        return $result;
    }
1064484
public function get($key)
    {
        if (! isset($this->storage[$key])) {
            return;
        }

        $item = $this->storage[$key];

        $expiresAt = $item['expiresAt'] ?? 0;

        if ($expiresAt !== 0 && $this->currentTime() > $expiresAt) {
            $this->forget($key);

            return;
        }

        return $item['value'];
    }
1316675
public function getValue($key) {
		if(isset($this->jsonArray[$key])) {
			return $this->jsonArray[$key];
		}

		return NULL;
	}
378831
static function prev_month($key = null) {
            $prev = self::today_if_null(date('Y') . '-' . date('M') . '-01') - 24 * 3600;
            $ret  = array(
                'y' => (int)date('Y', $prev),
                'm' => (int)date('m', $prev),
            );
            return $key ? Arr::get($ret, $key) : $ret;
        }