Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
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\Internals\BlockTable
Definition
block.php:26
Bitrix\Landing\Update\Block\FontWeight
Definition
fontweight.php:8
Bitrix\Landing\Update\Block\FontWeight\updateLanding
static updateLanding(int $lid)
Definition
fontweight.php:51
Bitrix\Landing\Update\Block\FontWeight\$blockId
$blockId
Definition
fontweight.php:15
Bitrix\Landing\Update\Block\FontWeight\$content
$content
Definition
fontweight.php:19
Bitrix\Landing\Update\Block\FontWeight\__construct
__construct($blockId, $content)
Definition
fontweight.php:21
Bitrix\Landing\Update\Block\FontWeight\update
update()
Definition
fontweight.php:27
Bitrix\Landing\Update\Block\FontWeight\FONT_BOLD_MATCHER
const FONT_BOLD_MATCHER
Definition
fontweight.php:10
Bitrix\Landing\Update\Block\FontWeight\changeWeightClass
changeWeightClass()
Definition
fontweight.php:45
Bitrix\Landing\Update\Block\FontWeight\save
save()
Definition
fontweight.php:35
Bitrix\Landing\Update\Block
Definition
buttons.php:3
modules
landing
lib
update
block
fontweight.php
Создано системой
1.10.0