Pozwala automatycznie zalogować użytkownika przez dany czas
@param int $time
186157
public function rememberMe($time)
    {
        //rola zalogowana
        if ($this->hasIdentity()) {
            //ustawianie ciasteczka
            new \Mmi\Http\Cookie('remember', 'id=' . $this->getId() . '&key=' . md5($this->getSalt() . $this->getId()), null, time() + $time);
        }
    }
933089
public function getTime($time = self::TIME_MODIFIED)
    {
        $result = false;
        $info = $this->getInfo();

        if(isset($info[$time])) {
            $result = new \DateTime('@'.$info[$time]);
        }

        return $result;
    }
1032880
public static function run($time = null)
    {
        if ($time) {
            self::$time = $time;
        }

        self::installHandler();

        pcntl_alarm(1);

        while (true) {
            pcntl_signal_dispatch();
            usleep(100000);
        }
    }
1349429
public function seeTimeWasInHours($time, $hours) {
        \PHPUnit_Framework_Assert::assertEquals($hours, $this->_ParseDate($time)->diffInHours($this->_GetNow(), false));
    }
1320884
protected function _setStorageTimePreview($time = null) {
		$time = (int)$time;
		if ($time > 0) {
			$this->_storageTimePreview = $time;
		}
	}
645318
public static function createFromDateString($time)
    {
        $interval = parent::createFromDateString($time);
        if ($interval instanceof DateInterval && !($interval instanceof static)) {
            $interval = static::instance($interval);
        }

        return static::instance($interval);
    }
1130040
public function setDatetime($dateTime)
    {
        $dt = strtotime($dateTime);
        if ($dt == -1) {
            $this->setError(
                "Date of " . $dateTime
                . " Cannot be parsed correctly. It should be in"
                . " a format parsable by PHP's strtotime() function."
            );
        } else {
            $this->dateTime = $dateTime;
            $this->setSeconds($dt);
        }
    }
66309
public function gc( $time )
	{
		// if we don't have the last active key we cannot execute 
		// the garbage collection
		if ( !in_array( 'last_active', $this->index_fields ) )
		{
			return false;
		}
		
		\DB::delete( $this->table )
			->where( 'last_active', '<', time() - $time )
			->run( $this->database );
	}
362045
function sweep(int $time) {
        if($time <= 0) {
            $this->clear();
            return;
        }
        
        $amount = 0;
        foreach($this->data as $key => $msg) {
            if($msg->createdTimestamp > (\time() - $time)) {
                $this->delete($msg->id);
                unset($msg);
                
                $amount++;
            }
        }
        
        return $amount;
    }
721049
protected function _setStorageTimeUpload($time = null) {
		$time = (int)$time;
		if ($time > 0) {
			$this->_storageTimeUpload = $time;
		}
	}
49056
public static function isValidTime($time)
    {
        if (preg_match('^(0|1|2)[0-9]([:](0|1|2|3|4|5)[0-9]){2}$', $time)) {
            $hour   = (int)substr($time, 0, 2);
            $minute = (int)substr($time, 3, 2);
            $second = (int)substr($time, 6, 2);
            if ($hour < 24 && $minute < 60 && $second < 60) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
858891
public function updateLastActivity(string $time = null): void
    {
        $this->timestamps = false;
        $this->last_activity = is_null($time) ? $this->freshTimestamp() : $time;
        $this->save();
    }
1063931
public static function isThisMonth($time): bool
    {
        return (self::factory($time)->format('m-Y') === self::factory()->format('m-Y'));
    }
159618
protected function log($time)
	{
		// Build the actual query
		$query = $this->toString();

		Event::trigger('database_query', [
			'query' => $query,
			'time'  => $time
		]);

		// Add it to the internal logs
		$this->log[] = $query;
		$this->count++;
		$this->timer += $time;
	}
105573
public function diff($time) : DateInterval
    {
        $tmp = new self($time);

        return new DateInterval(abs($this->time - $tmp->getUnixTstamp()));
    }
227480
protected function _timeToMongoDate($time)
    {
        if(!is_numeric($time)) {
            $time = strtotime($time);
            if(!$time) {
                $time = time();
            }
        }
        
        return new \MongoDate($time);
    }
569956
static public function validate($time)
    {
      // Check if date is a string
      if(is_string($time) && strlen(trim($time)) > 0)
        return false;
        
      // Check if date matches pattern
      if(!preg_match('/^' . self::PATTERN . '$/', $time, $matches))
        return false;
          
      // Extract values from time
      if(count($matches) == 5)
        list($original, $hours, $minutes, $seconds, $microtime) = $matches;
      else
        list($original, $hours, $minutes, $seconds) = $matches;
              
      // If microtime is set at it to seconds
      if(isset($microtime))
        $seconds += $microtime;
                
      // Check if all values are valid
      if(!self::validateTime($hours, $minutes, $seconds))
        return false;
                  
      return true;
    }