1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
companygroup.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Internals;
4
5use Bitrix\Main;
6
7
24class CompanyGroupTable extends Main\Entity\DataManager
25{
26 public static function getTableName()
27 {
28 return 'b_sale_company_group';
29 }
30
31 public static function getMap()
32 {
33 return [
34 'ID' => [
35 'data_type' => 'integer',
36 'primary' => true,
37 'autocomplete' => true,
38 ],
39 'COMPANY_ID' => [
40 'data_type' => 'integer',
41 ],
42 'GROUP_ID' => [
43 'data_type' => 'integer',
44 'required' => true,
45 ],
46 ];
47 }
48
49 public static function deleteByCompanyId($id)
50 {
51 $id = intval($id);
52 if ($id <= 0)
53 {
54 throw new Main\ArgumentNullException('id');
55 }
56
57 $itemsList = static::getList(
58 [
59 'filter' => ['COMPANY_ID' => $id],
60 'select' => ['ID'],
61 ]
62 );
63 while ($item = $itemsList->fetch())
64 {
65 static::delete($item['ID']);
66 }
67 }
68}
static deleteByCompanyId($id)
Определения companygroup.php:49