Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
shipmentextraservice.php
1<?php
3
6Loc::loadMessages(__FILE__);
7
35class ShipmentExtraServiceTable extends Main\Entity\DataManager
36{
37 public static function getFilePath()
38 {
39 return __FILE__;
40 }
41
42 public static function getTableName()
43 {
44 return 'b_sale_order_delivery_es';
45 }
46
47 public static function getMap()
48 {
49 return array(
50 'ID' => array(
51 'data_type' => 'integer',
52 'primary' => true,
53 'autocomplete' => true,
54 'title' => Loc::getMessage('ORDER_DELIVERY_EXTRA_SERVICES_ENTITY_ID_FIELD'),
55 ),
56 'SHIPMENT_ID' => array(
57 'data_type' => 'integer',
58 'required' => true,
59 'title' => Loc::getMessage('ORDER_DELIVERY_EXTRA_SERVICES_ENTITY_SHIPMENT_ID_FIELD'),
60 ),
61 'EXTRA_SERVICE_ID' => array(
62 'data_type' => 'integer',
63 'required' => true,
64 'title' => Loc::getMessage('ORDER_DELIVERY_EXTRA_SERVICES_ENTITY_EXTRA_SERVICE_ID_FIELD'),
65 ),
66 'VALUE' => array(
67 'data_type' => 'string',
68 'validation' => array(__CLASS__, 'validateValue'),
69 'title' => Loc::getMessage('ORDER_DELIVERY_EXTRA_SERVICES_ENTITY_VALUE_FIELD'),
70 ),
71 'EXTRA_SERVICE' => array(
72 'data_type' => '\Bitrix\Sale\Delivery\ExtraServices\Table',
73 'reference' => array('=this.EXTRA_SERVICE_ID' => 'ref.ID'),
74 ),
75 );
76 }
77 public static function validateValue()
78 {
79 return array(
80 new Main\Entity\Validator\Length(null, 255),
81 );
82 }
83
84 public static function deleteByShipmentId($shipmentId)
85 {
86 if(intval($shipmentId) > 0)
87 {
88 $con = \Bitrix\Main\Application::getConnection();
89 $sqlHelper = $con->getSqlHelper();
90 $strSql = "DELETE FROM ".self::getTableName()." WHERE SHIPMENT_ID=".$sqlHelper->forSql($shipmentId);
91 $con->queryExecute($strSql);
92 }
93 }
94}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29