1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
fontweight.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Landing\Update\Block;
4
5
use Bitrix\Landing\Internals\BlockTable;
6
7
class
FontWeight
8
{
9
// todo: check this!
10
protected
const
FONT_BOLD_MATCHER
=
'/font-weight-bold/i'
;
11
15
protected
$blockId
;
19
protected
$content
;
20
21
public
function
__construct
(
$blockId
,
$content
)
22
{
23
$this->blockId =
$blockId
;
24
$this->content =
$content
;
25
}
26
27
public
function
update
(): void
28
{
29
// todo: what about partners? !!!!!!!!!!!!!
30
$this->
changeWeightClass
();
31
32
$this->
save
();
33
}
34
35
protected
function
save
(): void
36
{
37
BlockTable::update(
38
$this->blockId,
39
[
40
'CONTENT'
=> $this->content
41
]
42
);
43
}
44
45
protected
function
changeWeightClass
()
46
{
47
$this->content = preg_replace(self::FONT_BOLD_MATCHER,
'g-font-weight-700'
, $this->content);
48
}
49
50
51
public
static
function
updateLanding
(
int
$lid): void
52
{
53
$res
= BlockTable::getList(
54
[
55
'select'
=> [
56
'ID'
,
'CONTENT'
57
],
58
'filter'
=> [
59
'LID'
=> $lid,
60
],
61
]
62
);
63
while
($row =
$res
->fetch())
64
{
65
$block =
new
self
($row[
'ID'
], $row[
'CONTENT'
]);
66
$block->update();
67
}
68
}
69
70
}
Bitrix\Landing\Update\Block\FontWeight
Определения
fontweight.php:8
Bitrix\Landing\Update\Block\FontWeight\updateLanding
static updateLanding(int $lid)
Определения
fontweight.php:51
Bitrix\Landing\Update\Block\FontWeight\$blockId
$blockId
Определения
fontweight.php:15
Bitrix\Landing\Update\Block\FontWeight\$content
$content
Определения
fontweight.php:19
Bitrix\Landing\Update\Block\FontWeight\__construct
__construct($blockId, $content)
Определения
fontweight.php:21
Bitrix\Landing\Update\Block\FontWeight\update
update()
Определения
fontweight.php:27
Bitrix\Landing\Update\Block\FontWeight\FONT_BOLD_MATCHER
const FONT_BOLD_MATCHER
Определения
fontweight.php:10
Bitrix\Landing\Update\Block\FontWeight\changeWeightClass
changeWeightClass()
Определения
fontweight.php:45
Bitrix\Landing\Update\Block\FontWeight\save
save()
Определения
fontweight.php:35
$res
$res
Определения
filter_act.php:7
bitrix
modules
landing
lib
update
block
fontweight.php
Создано системой
1.14.0