uawdijnntqw1x1x1
IP : 3.21.126.184
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
b24.axolotl.ru
/
.
/
public_html
/
bitrix
/
modules
/
crm
/
lib
/
itemidentifier.php
/
/
<?php namespace Bitrix\Crm; use Bitrix\Main\ArgumentException; use Bitrix\Main\ArgumentOutOfRangeException; class ItemIdentifier { /** @var int */ private $entityTypeId; /** @var int */ private $entityId; /** * ItemIdentifier constructor. * * @param int $entityTypeId * @param int $entityId */ public function __construct(int $entityTypeId, int $entityId) { $this->setEntityTypeId($entityTypeId); $this->setEntityId($entityId); } /** * Creates a new ItemIdentifier object, that is based on the provided $item * * @param Item $item * * @return ItemIdentifier */ public static function createByItem(Item $item): ItemIdentifier { return new static($item->getEntityTypeId(), $item->getId()); } /** * Returns $entityTypeId of the item * * @return int */ public function getEntityTypeId(): int { return $this->entityTypeId; } private function setEntityTypeId(int $entityTypeId): ItemIdentifier { if (!\CCrmOwnerType::isCorrectEntityTypeId($entityTypeId)) { throw new ArgumentException('The provided $entityTypeId is invalid', 'entityTypeId'); } $this->entityTypeId = $entityTypeId; return $this; } /** * Returns $entityId of the item * * @return int */ public function getEntityId(): int { return $this->entityId; } private function setEntityId(int $entityId): ItemIdentifier { if ($entityId <= 0) { throw new ArgumentOutOfRangeException('The provided $entityId is invalid', 1); } $this->entityId = $entityId; return $this; } /** * Transform this object to string * * @return string */ public function __toString(): string { $entityTypeId = $this->getEntityTypeId(); $entityName = \CCrmOwnerType::ResolveName($entityTypeId); $entityId = $this->getEntityId(); return "Entity type ID: {$entityTypeId} ({$entityName}), entity ID: {$entityId}"; } public function getHash(): string { return 'type_' . $this->getEntityTypeId() . '_id_' . $this->getEntityId(); } /** * Return array representation of this object * * @return array */ public function toArray(): array { return [ 'ENTITY_TYPE_ID' => $this->getEntityTypeId(), 'ENTITY_ID' => $this->getEntityId(), ]; } public static function createFromArray(array $data): ?self { if (isset($data['ENTITY_TYPE_ID']) && isset($data['ENTITY_ID'])) { return new self((int)$data['ENTITY_TYPE_ID'], (int)$data['ENTITY_ID']); } return null; } }
/var/www/axolotl/data/www/b24.axolotl.ru/./public_html/bitrix/modules/crm/lib/itemidentifier.php