Retrieve session lifetime

@param \Doctrine_Record $record
@return int
3195
public function _getLifetime(\Doctrine_Record $record)
    {
        $return = $this->_lifetime;

        if (!$this->_overrideLifetime) {
            $return = (int) $record->{$this->_lifetimeColumn};
        }

        return $return;
    }
635188
public function getRequestCount(AuthenticationRecordInterface $authenticationRecord): int
    {
        $fiveMinutesAgo = new \DateTime('now', new \DateTimeZone('UTC'));
        $fiveMinutesAgo->modify('-5 minutes');

        $query = $this->getRepository()->createQueryBuilder('r')
            ->select('COUNT(r.id) AS total')
            ->where('r.authentication = :authentication')
            ->andWhere('r.request_time > :since')
            ->setParameter('authentication', $authenticationRecord)
            ->setParameter('since', $fiveMinutesAgo)
            ->getQuery();

        return $query->getSingleScalarResult();
    }
912470
protected function getRealLifetime($lifetime): int
    {
        if (null === $lifetime) {
            $lifetime = $this->defaultLifetime;
        }
        if (0 === $lifetime || $lifetime > $this->maximumLifetime) {
            $lifetime = $this->maximumLifetime;
        }

        return (int)$lifetime;
    }
1070493
public function getRowClass($record)
    {
        $value = '';

        /**
         * @event backend.list.injectRowClass
         * Provides opportunity to inject a custom CSS row class
         *
         * If a value is returned from this event, it will be used as the value for the row class.
         * `$value` is passed by reference so modifying the variable in place is also supported. Example usage:
         *
         *     Event::listen('backend.list.injectRowClass', function($listWidget, $record, &$value) {
         *         $value .= '-modified';
         *     });
         *
         * Or
         *
         *     $listWidget->bindEvent('list.injectRowClass', function ($record, $value) {
         *         return 'strike';
         *     });
         *
         */
        if ($response = $this->fireSystemEvent('backend.list.injectRowClass', [$record, &$value])) {
            $value = $response;
        }

        return $value;
    }
1001534
public function getLifetime() {
        if (!self::$lifetime) {
            $sessionExpirationHours = engineGet('Config', 'sessionExpirationHours', false);
            if (!$sessionExpirationHours)
                $sessionExpirationHours = 2;
            self::$lifetime = 60 * 60 * $sessionExpirationHours;
        }

        return self::$lifetime;
    }
656087
protected function processRecord(Record $record)
    {

        foreach ($this->processors as $processor) {
            if ($this->isInstanceOf($processor, ProcessorInterface::class)) {
                $processor->processRecord($record);
            } else {
                call_user_func($processor, $record);
            }
        }
    }
443825
public function retrieve($record)
    {
        $params['index'] = $this->getName();
        $params['type'] = $record['type'];
        $params['id'] = $record['id'];

        self::getClient()->get($params);
    }
542057
public function gc($lifetime = 1440)
	{
		// Determine the timestamp threshold with which to purge old sessions.
		$past = time() - $lifetime;

		try
		{
			$query = $this->db->getQuery(true);
			$query->delete($this->db->quoteName('#__session'))
				->where($this->db->quoteName('time') . ' < ' . $this->db->quote((int) $past));

			// Remove expired sessions from the database.
			$this->db->setQuery($query);

			return (boolean) $this->db->execute();
		}
		catch (\Exception $e)
		{
			return false;
		}
	}
844388
private function preParse($record)
    {
        $container = $this->preParse->handle(new ParserContainer($this, $record));

        if ($container instanceof ParserContainer) {
            return $container->getValue();
        }

        throw new \RuntimeException();
    }
687125
public function expires($key)
    {
        if (!isset($this->records[$key])) {
            return 0;
        }

        return (int) max(0, $this->records[$key]['expire'] - time());
    }
188674
public function gc($lifetime = 0)
    {
        $timeout = $this->getConfig('timeout');

        //find all sessions that are older than $timeout
        $olderThan = time() - $timeout;

        //no ack required
        $this->sessions->remove(
            array('last_accessed' => array('$lt' => new MongoDate($olderThan))),
            ( (class_exists('MongoClient')) ? (array('w'=>0)) : (array('safe'=>false)) )
        );

        return true;
    }
318888
private function getNormalisedRecordName(Record $record): string
    {
        return '@' === $record->getName()
            ? $record->getDomain()
            : $record->getName() . '.' . $record->getDomain();
    }
734180
public function calcPageCount($records)
    {
        if(0 === $records % $this->count)
        {
            return $records / $this->count;
        }
        else
        {
            return ((int)($records / $this->count)) + 1;
        }
    }
822292
function session_lifespan( $ttl = null, $hibernate = null ){
		$current = $this->sess_ttl;
		if( $ttl !== null ){
			$this->sess_ttl = $ttl;
		}
		if( $hibernate !== null ){
			$this->sess_hibernate = $hibernate;
		}
		return $current;
	}
268665
public static function adhoc_task_from_record($record) {
        $classname = self::get_canonical_class_name($record->classname);
        if (!class_exists($classname)) {
            debugging("Failed to load task: " . $classname, DEBUG_DEVELOPER);
            return false;
        }
        $task = new $classname;
        if (isset($record->nextruntime)) {
            $task->set_next_run_time($record->nextruntime);
        }
        if (isset($record->id)) {
            $task->set_id($record->id);
        }
        if (isset($record->component)) {
            $task->set_component($record->component);
        }
        $task->set_blocking(!empty($record->blocking));
        if (isset($record->faildelay)) {
            $task->set_fail_delay($record->faildelay);
        }
        if (isset($record->customdata)) {
            $task->set_custom_data_as_string($record->customdata);
        }

        if (isset($record->userid)) {
            $task->set_userid($record->userid);
        }

        return $task;
    }
255229
protected function setTimestampsOnAttach(array $record, $exists = false)
	{
		$fresh = $this->parent->freshTimestamp();

		if ( ! $exists) $record[$this->createdAt()] = $fresh;

		$record[$this->updatedAt()] = $fresh;

		return $record;
	}
1022198
public function isHandling(array $record)
    {
        $level = array_search($record['level'], self::$levels);
        return $level >= $this->level;
    }