Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Document.php
1<?php
2
4
5class Document extends Entity\EO_DebuggerSessionDocument
6{
7 public function getParameterDocumentId(): array
8 {
9 $this->fillSession();
10 $session = $this->getSession();
11
12 return [
13 $session->getModuleId(),
14 $session->getEntity(),
15 $this->getDocumentId(),
16 ];
17 }
18
19 public function getSignedDocument(): string
20 {
21 $this->fillSession();
22 $session = $this->getSession();
23
24 return \CBPDocument::signParameters([
25 $session->getParameterDocumentType(),
26 $this->getRealCategoryId(),
27 $this->getDocumentId(),
28 ]);
29 }
30
31 public function getRealCategoryId()
32 {
33 $runtime = \CBPRuntime::GetRuntime();
34 $runtime->StartRuntime();
35 $documentService = $runtime->GetService('DocumentService');
36
37 $this->fillSession();
38 $session = $this->getSession();
39
40 return $documentService->getFieldValue(
42 'CATEGORY_ID',
43 $session->getParameterDocumentType()
44 );
45 }
46
47 public function toArray(): array
48 {
49 return [
50 'Id' => $this->getId(),
51 'SessionId' => $this->getSessionId(),
52 'DocumentId' => $this->getDocumentId(),
53 'DocumentCategoryId' => $this->getRealCategoryId(),
54 'DateExpire' => $this->getDateExpire() ? $this->getDateExpire()->getTimestamp() : null,
55 ];
56 }
57}