Vrati entitu podle klice
@param DateTimeInterface $date
@param string $page
@return IEntity|TrackingPages|null
960436
public function getByKey(DateTimeInterface $date, string $page): ?TrackingPages
	{
		$builder = $this->builder()
			->andWhere('[datefield] = DATE(%dt)', $date)
			->andWhere('[page] = %s', $page);
		return $this->toEntity($builder);
	}
1018951
public function dateIsEarlier(\DateTime $date) {
    $dateEarlier = FALSE;

    $t1 = $this->start_date->getTimeStamp();

    $t3 = $date->getTimeStamp();

    if ($t3 < $t1) {
      $dateEarlier = TRUE;
    }

    return $dateEarlier;
  }
924533
private function dateIsInRequestFrame(\DateTime $date)
    {
        if (null === $date) {
            return false;
        }

        return (new \DateTime())->add(self::getResetInterval()) < $date->add(self::getRequestInterval());
    }
909229
public function page($page = null) {
        if ($page === null) {
            return $this->page;
        }

        $this->page = (int) $page;

        return $this;
    }
315026
protected function formatDateTime(DateTimeInterface $date): string
    {
        return (new DateTime)
            ->setTimestamp($date->getTimestamp())
            ->setTimezone(new DateTimeZone('UTC'))
            ->format('Y-m-d\TH:i:s\Z');
    }
276631
private function isAdvanced(PageInterface $page)
    {
        if (null !== $controller = $page->getController()) {
            if (array_key_exists($controller, $this->pageConfig['controllers'])) {
                return $this->pageConfig['controllers'][$controller]['advanced'];
            }
            throw new \RuntimeException("Undefined page controller '{$controller}'.");
        }

        return null;
    }
1153374
public function index($page = null)
    {
        $url = sprintf('buckets/%d/chats/%d/integrations.json', $this->bucket, $this->parent);

        $chatbots = $this->client->get($url, [
            'query' => [
                'page' => $page,
            ],
        ]);

        return $this->indexResponse($chatbots, Chatbot::class)->map(function ($chatbot) {
            $chatbot->inContext($this->bucket, $this->parent);
            return $chatbot;
        });
    }
165076
public function get($id, $limit = null, $page = null, \DateTime $dateFrom = null, \DateTime $dateTo = null)
    {
        $options = array();

        if ($limit) {
            $options['limit'] = (int) $limit;
        }

        if ($page) {
            $options['page'] = (int) $page;
        }

        if ($dateFrom) {
            $options['dateFrom'] = $dateFrom->format('c');
        }

        if ($dateTo) {
            $options['dateTo'] = $dateTo->format('c');
        }

        return $this->makeRequest("{$this->endpoint}/$id", $options);
    }
107324
final public static function asUtcSql($date)
    {
        if (!empty($date)) {
            if ($date instanceof \DateTimeInterface) {
                return $date->setTimezone(self::tzUtc())->format('Y-m-d H:i:s');
            } else {
                return self::asDateTime($date, "UTC")->format('Y-m-d H:i:s');
            }
        } else {
            return null;
        }
    }
521961
private function getAdoptedDateTime(DateTimeInterface $dateTime): \DateTime
    {
        return (new \DateTime())
            ->setTimestamp($dateTime->getTimestamp())
            ->setTimezone(new DateTimeZone('Asia/Manila'));
    }
703366
public static function tokensExpireIn(DateTimeInterface $date = null, $clientId = null)
    {
        if (! $clientId) return Passport::tokensExpireIn($date);

        if (is_null($date)) {
            return isset(static::$tokensExpireAt[$clientId])
                ? Carbon::now()->diff(static::$tokensExpireAt[$clientId])
                : Passport::tokensExpireIn();
        } else {
            static::$tokensExpireAt[$clientId] = $date;
        }

        return new static;
    }
2621
public function withExpiry(\DateTimeInterface $date): self
    {
        $new = clone $this;

        if ($date instanceof \DateTimeImmutable) {
            $new->expiry = $date;
        } elseif ($date instanceof \DateTime) {
            $new->expiry = \DateTimeImmutable::createFromMutable($date);
        } else {
            $new->expiry = new \DateTimeImmutable("@" . $date->getTimestamp());
        }

        return $new;
    }
456375
public static function parseDate($date, DateTimeZone $tz = null)
    {
        // Format is YYYYMMDD
        $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/', $date, $matches);

        if (!$result) {
            throw new InvalidDataException('The supplied iCalendar date value is incorrect: '.$date);
        }

        if (is_null($tz)) {
            $tz = new DateTimeZone('UTC');
        }

        try {
            $date = new DateTimeImmutable($matches[1].'-'.$matches[2].'-'.$matches[3], $tz);
        } catch (\Exception $e) {
            throw new InvalidDataException('The supplied iCalendar date value is incorrect: '.$date);
        }

        return $date;
    }
1033557
public static function buildFromDateTimeInterface(DateTimeInterface $date)
    {
        $parts = explode('|', $date->format('Z|I|T'));

        return new static((int)$parts[0], (bool)$parts[1], $parts[2]);
    }
63862
static function FindPageGroup(Page $page)
    {
        $currPage = $page;
        $result = null;
        do 
        {
            $result = $currPage->GetUserGroup();
            $currPage = $currPage->GetParent();
        } 
        while (!$result && $currPage);
        if (!$result && $page->GetSite())
        {
            return $page->GetSite()->GetUserGroup();
        }
        return $result;
    }
1174025
protected static function expectDateTime($date)
    {
        if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) {
            throw new InvalidArgumentException(
                'Expected null, string, DateTime or DateTimeInterface, '.
                (is_object($date) ? get_class($date) : gettype($date)).' given'
            );
        }
    }
200935
public static DateTime toDate(Object o, TimeZone tz) throws PageException {
	return DateCaster.toDateAdvanced(o, tz);
    }