403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/calendar/lib/sync/push/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/calendar/lib/sync/push/push.php
<?php

namespace Bitrix\Calendar\Sync\Push;

use Bitrix\Calendar\Core\Base\Date;
use Bitrix\Calendar\Sync\Dictionary;

class Push
{
	/**
	 * @var string
	 */
	private string $entityType;
	/**
	 * @var int
	 */
	private int $entityId;
	/**
	 * @var string
	 */
	private string $channelId;
	/**
	 * @var string
	 */
	private string $resourceId;
	/**
	 * @var Date
	 */
	private Date $expireDate;
	/**
	 * @var string|null
	 */
	private ?string $processStatus = null;
	/**
	 * @var ?Date
	 */
	private ?Date $firstPushDate = null;

	/**
	 * @return string
	 */
	public function getEntityType(): string
	{
		return $this->entityType;
	}

	/**
	 * @param string $entityType
	 * @return Push
	 */
	public function setEntityType(string $entityType): Push
	{
		$this->entityType = $entityType;
		return $this;
	}

	/**
	 * @return int
	 */
	public function getEntityId(): int
	{
		return $this->entityId;
	}

	/**
	 * @param int $entityId
	 * @return Push
	 */
	public function setEntityId(int $entityId): Push
	{
		$this->entityId = $entityId;
		return $this;
	}

	/**
	 * @return string
	 */
	public function getChannelId(): string
	{
		return $this->channelId;
	}

	/**
	 * @param string $channelId
	 * @return Push
	 */
	public function setChannelId(string $channelId): Push
	{
		$this->channelId = $channelId;
		return $this;
	}

	/**
	 * @return string
	 */
	public function getResourceId(): string
	{
		return $this->resourceId;
	}

	/**
	 * @param string $resourceId
	 * @return Push
	 */
	public function setResourceId(string $resourceId): Push
	{
		$this->resourceId = $resourceId;
		return $this;
	}

	/**
	 * @return Date
	 */
	public function getExpireDate(): Date
	{
		return $this->expireDate;
	}

	/**
	 * @param Date $expireDate
	 * @return Push
	 */
	public function setExpireDate(Date $expireDate): Push
	{
		$this->expireDate = $expireDate;
		return $this;
	}

	/**
	 * @return bool
	 */
	public function isExpired(): bool
	{
		return ((int)$this->expireDate->format('U')) < time();
	}

	/**
	 * @return bool
	 */
	public function isProcessed(): bool
	{
		return in_array(
			$this->processStatus,
			[
				Dictionary::PUSH_STATUS_PROCESS['block'],
				Dictionary::PUSH_STATUS_PROCESS['unprocessed'],
			],
			true
		);
	}

	/**
	 * @return bool
	 */
	public function isBlocked(): bool
	{
		return $this->processStatus === Dictionary::PUSH_STATUS_PROCESS['block'];
	}

	/**
	 * @return bool
	 */
	public function isUnprocessed(): bool
	{
		return $this->processStatus === Dictionary::PUSH_STATUS_PROCESS['unprocessed'];
	}

	/**
	 * @return bool
	 */
	public function isUnblocked(): bool
	{
		return $this->processStatus === Dictionary::PUSH_STATUS_PROCESS['unblocked'];
	}

	/**
	 * @param bool $processed
	 * @return Push
	 */
	public function setProcessStatus(string $processStatus): Push
	{
		if (in_array($processStatus, Dictionary::PUSH_STATUS_PROCESS, true))
		{
			$this->processStatus = $processStatus;
		}

		return $this;
	}

	/**
	 * @return string|null
	 */
	public function getProcessStatus(): ?string
	{
		return $this->processStatus;
	}

	/**
	 * @return Date|null
	 */
	public function getFirstPushDate(): ?Date
	{
		return $this->firstPushDate;
	}

	/**
	 * @param Date|null $firstPushDate
	 * @return Push
	 */
	public function setFirstPushDate(?Date $firstPushDate): Push
	{
		$this->firstPushDate = $firstPushDate;
		return $this;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit