return time left (in seconds) for basket before expiration

@return int
178757
public function getTimeLeft()
    {
        $iTimeout = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iPsBasketReservationTimeout');
        if ($iTimeout > 0) {
            $oRev = $this->getReservations();
            if ($oRev && $oRev->getId()) {
                $iTimeout -= (\OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime() - (int) $oRev->oxuserbaskets__oxupdate->value);
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iBasketReservationTimeout", $oRev->oxuserbaskets__oxupdate->value);
            } elseif (($iSessionTimeout = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("iBasketReservationTimeout"))) {
                $iTimeout -= (\OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime() - (int) $iSessionTimeout);
            }

            return $iTimeout < 0 ? 0 : $iTimeout;
        }

        return 0;
    }
1253790
public function getLastAdminActivityAgo()
    {
        $now = \Yii::$app->formatter->asTimestamp(time());
        return (int)($now - (int)$this->last_admin_activity_at);
    }
528917
public function last()
    {
        if ($this->isEmpty()) {
            return null;
        }

        $lastItem = array_slice($this->container, -1, 1);

        return current($lastItem);
    }
233314
public function duration()
    {
        if ($update = $this->latest()) {
            return $this->wrappedObject->created_at->diffInSeconds($update->occurred_at);
        }

        return 0;
    }
924972
public function getIsExpired()
    {
        $createdAt = $this->getCreatedAt();
        if ($this->getExpiredAfter() === false || $createdAt === null) {
            return false;
        }
        if ($this->timeType == static::$timeTypeLocal) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        } elseif ($this->timeType == static::$timeTypeUtc) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentUtcDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        }
        return false;
    }
1187635
public function getDuration()
    {
        if (null === $this->data) {
            return 0;
        }

        $time = 0;
        foreach ($this->data as $data) {
            $time += $data['duration'];
        }

        return $time;
    }
213641
public function getExpiresAt() : ?int 
    {
        if ( ! $this->hasExpiresAt()) {
            $this->setExpiresAt($this->getDefaultExpiresAt());
        }
        return $this->expiresAt;
    }
335503
public function getAt(): int
    {
        if ($this->at < 0) {
            return Location::BeforeFirstRow;
        }

        if ($this->at > $this->rowCount()) {
            return Location::AfterLastRow;
        }

        return $this->at;
    }
479703
function time(): int {
        if($this->nativeHrtime) {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \hrtime(true);
            $elapsed = (int) ($time - $this->lastTime);
            $this->lastTime = $time;
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getLastElapsedTime(\HRTime\Unit::NANOSECOND);
            $this->timer->start();
        } else {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \microtime(true);
            $elapsed = $time - $this->lastTime;
            
            $this->lastTime = $time;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }
440944
protected function getLifetime()
    {
        $params = session_get_cookie_params();
        $cookieLifetime = (int)$params['lifetime'];
        $gcLifetime = (int)ini_get('session.gc_maxlifetime');

        return $cookieLifetime ? min($cookieLifetime, $gcLifetime) : $gcLifetime;
    }
774646
public function getLinkExpirationTime()
    {
        $iExpTime = $this->oxfiles__oxlinkexptime->value;
        //if value is -1, takes global options
        if ($iExpTime < 0) {
            $iExpTime = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("iLinkExpirationTime");
        }

        return $iExpTime;
    }
771042
protected function get12hHour() : int
   {

      if ( $this->isAnteMeridiem() )
      {
         return $this->getHour();
      }

      if ( $this->properties[ 'hour' ] == 0 )
      {
         return 12;
      }

      if ( $this->properties[ 'hour' ] > 12 )
      {
         return $this->properties[ 'hour' ] - 12;
      }

      return $this->properties[ 'hour' ];

   }
659452
public function getLastPage()
    {
        return (int) \max(self::MIN_PAGE, \ceil($this->getTotal() / $this->getLimit()));
    }
889647
private function expiration() {

		if ( isset( $this->expiration ) ) {
			return $this->expiration;
		}

		/**
		 * Filters the expiration.
		 *
		 * @since 1.0.0
		 *
		 * @param int $expiration Expiration in seconds.
		 */
		$this->expiration = (int) apply_filters( self::FILTER_EXPIRATION, 300 );

		return $this->expiration;
	}
1191070
public function getIsExpired()
    {
        $expirationDuration = $this->getExpireDuration();
        if (empty($expirationDuration)) {
            return false;
        }

        return (time() >= ($this->createTimestamp + $expirationDuration));
    }
426979
public function getLastAccessedAt() {
		$timestamp = fileatime($this->pathname);
		$time = new DateTime();
		$time->setTimestamp($timestamp);
		return $time;
	}
1321947
public function getBasketCost()
    {
        $cost = $this->find()
            ->where([
                'id_user' => $this->idUser,
                'storage' => $this->owner->storageName
            ])
            ->sum('price*count');

        return ($cost) ? $cost : 0;
    }