• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/scrum/service/entityservice.php
  • Класс: BitrixTasksScrumServiceEntityService
  • Вызов: EntityService::getEntityById
public function getEntityById(int $entityId): EntityForm
{
	if (array_key_exists($entityId, self::$entitiesById))
	{
		return self::$entitiesById[$entityId];
	}

	self::$entitiesById[$entityId] = new EntityForm();

	try
	{
		$queryObject = EntityTable::getList([
			'filter' => [
				'ID' => $entityId,
			],
		]);
		if ($entityData = $queryObject->fetch())
		{
			$entity = new EntityForm();

			$entity->fillFromDatabase($entityData);

			self::$entitiesById[$entityId] = $entity;
		}
	}
	catch (Exception $exception)
	{
		$this->errorCollection->setError(
			new Error(
				$exception->getMessage(),
				self::ERROR_COULD_NOT_READ_ENTITY
			)
		);
	}

	return self::$entitiesById[$entityId];
}