Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
filetableinstaller.php
1<?php
3
11
13{
18 public static function installAgent(int $offset = 0)
19 {
21 }
22
26 public static function fillFileTableFromTemplates(int $offset = 0):string
27 {
28 if ($offset === 0)
29 {
30 $templates = TemplateTable::getList([
31 'select' => [
32 'ID',
33 'CONTENT'
34 ]
35 ]);
36
37 while ($template = $templates->fetch())
38 {
40 $template['ID'],
41 FileTable::TYPES['TEMPLATE'],
42 $template['CONTENT'],
43 false
44 );
45 }
46 }
47
48 $letters = Letter::getList([
49 'select' => [
50 'ID',
51 ],
52 'filter' => [
53 '=MESSAGE_CODE' => MessageMail::CODE
54 ],
55 'offset' => $offset,
56 'limit' => 100,
57 'order' => [
58 'ID' => 'ASC'
59 ]
60 ]);
61 $counter = 0;
62
63 while ($letter = $letters->fetch())
64 {
65 $letter = Letter::createInstanceById($letter['ID']);
67 $letter->getId(),
68 FileTable::TYPES['LETTER'],
69 $letter->getMessage()->getConfiguration()->get('MESSAGE'),
70 false
71 );
72 $counter++;
73 }
74 $offset += $counter;
75
76 if ($counter < 100)
77 {
78 \COption::SetOptionInt('sender', 'sender_file_load_completed', 1);
79 return '';
80 }
81
82 return '\\Bitrix\\Sender\\Install\\FileTableInstaller::installAgent('.$offset.');';
83 }
84}
static getList(array $parameters=array())
static getList(array $parameters=array())
Definition letter.php:89
static createInstanceById($id=null, array $messageCodes=[])
Definition letter.php:196
static syncFiles(int $entityId, int $entityType, string $template, bool $deleteFiles=true, bool $onDeleteEntity=false)
Definition filetable.php:72