1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
iblocksequence.php
См. документацию.
1
<?php
2
3
use
Bitrix\Main\Application
;
4
use
Bitrix\Iblock
;
5
6
abstract
class
CAllIBlockSequence
7
{
8
public
$iblock_id
= 0;
9
public
$property_id
= 0;
10
11
public
function
__construct
(
$iblock_id
,
$property_id
= 0)
12
{
13
$this->iblock_id =
$iblock_id
;
14
$this->property_id =
$property_id
;
15
}
16
17
public
function
Drop
($bAll =
false
)
18
{
19
$connection
=
Application::getConnection
();
20
$helper =
$connection
->getSqlHelper();
21
22
$iblockId
= (int)$this->iblock_id;
23
$propertyId = (int)$this->property_id;
24
25
//OR part of the where is just for some cleanup
26
$strSql =
"
27
DELETE
28
FROM b_iblock_sequence
29
WHERE IBLOCK_ID = "
.
$iblockId
.
"
30
"
. (!$bAll ?
"AND CODE = 'PROPERTY_"
. $propertyId .
"'"
:
""
) .
"
31
OR NOT EXISTS (
32
SELECT * FROM
33
b_iblock_property
34
WHERE "
. $helper->getConcatFunction(
"'PROPERTY_'"
,
'b_iblock_property.ID'
) .
" = b_iblock_sequence.CODE
35
AND b_iblock_property.IBLOCK_ID = b_iblock_sequence.IBLOCK_ID
36
)
37
"
;
38
unset($helper);
39
40
$connection
->queryExecute($strSql);
41
unset(
$connection
);
42
}
43
44
public
function
GetCurrent
()
45
{
46
$row = Iblock\SequenceTable::getRow([
47
'select'
=> [
48
'SEQ_VALUE'
49
],
50
'filter'
=> [
51
'=IBLOCK_ID'
=> (
int
)$this->iblock_id,
52
'=CODE'
=>
'PROPERTY_'
. (
int
)$this->property_id,
53
],
54
]);
55
56
return
$row[
'SEQ_VALUE'
] ?? 0;
57
}
58
59
abstract
public
function
GetNext
();
60
61
abstract
public
function
SetNext
($value);
62
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Main\Application
Определения
application.php:30
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
CAllIBlockSequence
Определения
iblocksequence.php:7
CAllIBlockSequence\$iblock_id
$iblock_id
Определения
iblocksequence.php:8
CAllIBlockSequence\__construct
__construct($iblock_id, $property_id=0)
Определения
iblocksequence.php:11
CAllIBlockSequence\SetNext
SetNext($value)
CAllIBlockSequence\GetCurrent
GetCurrent()
Определения
iblocksequence.php:44
CAllIBlockSequence\$property_id
$property_id
Определения
iblocksequence.php:9
CAllIBlockSequence\Drop
Drop($bAll=false)
Определения
iblocksequence.php:17
CAllIBlockSequence\GetNext
GetNext()
$iblockId
$iblockId
Определения
iblock_catalog_edit.php:30
Bitrix\Iblock
bitrix
modules
iblock
classes
general
iblocksequence.php
Создано системой
1.14.0