1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
deletebyfiltertrait.php
См. документацию.
1
<?php
2
9
10
namespace
Bitrix\Main\ORM\Data\Internal
;
11
12
use
Bitrix\Main
;
13
use
Bitrix\Main\ORM\Query
;
14
15
trait DeleteByFilterTrait
16
{
22
public
static
function
deleteByFilter(
array
$filter
)
23
{
24
$entity
= static::getEntity();
25
$table
= static::getTableName();
26
27
$where =
Query\Query::buildFilterSql
(
$entity
,
$filter
);
28
29
if
($where <>
''
)
30
{
31
$where =
' where '
. $where;
32
}
33
else
34
{
35
throw
new
Main\ArgumentException
(
"Deleting by empty filter is not allowed, use truncate ({$table})."
,
'filter'
);
36
}
37
38
static::onBeforeDeleteByFilter($where);
39
40
$entity
->getConnection()->queryExecute(
"delete from {$table} {$where}"
);
41
42
static::cleanCache();
43
}
44
45
protected
static
function
onBeforeDeleteByFilter(
string
$where)
46
{
47
// may be implemented in a class that uses the trait
48
}
49
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\ORM\Query\Query\buildFilterSql
static buildFilterSql(Entity $entity, $filter)
Определения
query.php:3913
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
$filter
$filter
Определения
iblock_catalog_list.php:54
Bitrix\Main\ORM\Data\Internal
Определения
deletebyfiltertrait.php:10
Bitrix\Main\ORM\Query
Определения
chain.php:3
Bitrix\Main
Bitrix\Main\$table
$table
Определения
mysql_to_pgsql.php:36
bitrix
modules
main
lib
orm
data
internal
deletebyfiltertrait.php
Создано системой
1.14.0