Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
paymentextraservice.php
1<?php
3
6
7Loc::loadMessages(__FILE__);
8
9class PaymentExtraServiceTable extends Main\Entity\DataManager
10{
11 public static function getFilePath()
12 {
13 return __FILE__;
14 }
15
16 public static function getTableName()
17 {
18 return 'b_sale_order_payment_es';
19 }
20
21 public static function getMap()
22 {
23 return array(
24 'ID' => array(
25 'data_type' => 'integer',
26 'primary' => true,
27 'autocomplete' => true,
28 'title' => Loc::getMessage('ORDER_PAYMENT_EXTRA_SERVICES_ENTITY_ID_FIELD'),
29 ),
30 'PAYMENT_ID' => array(
31 'data_type' => 'integer',
32 'required' => true,
33 'title' => Loc::getMessage('ORDER_PAYMENT_EXTRA_SERVICES_ENTITY_PAYMENT_ID_FIELD'),
34 ),
35 'EXTRA_SERVICE_ID' => array(
36 'data_type' => 'integer',
37 'required' => true,
38 'title' => Loc::getMessage('ORDER_PAYMENT_EXTRA_SERVICES_ENTITY_EXTRA_SERVICE_ID_FIELD'),
39 ),
40 'VALUE' => array(
41 'data_type' => 'string',
42 'validation' => array(__CLASS__, 'validateValue'),
43 'title' => Loc::getMessage('ORDER_PAYMENT_EXTRA_SERVICES_ENTITY_VALUE_FIELD'),
44 ),
45 );
46 }
47 public static function validateValue()
48 {
49 return array(
50 new Main\Entity\Validator\Length(null, 255),
51 );
52 }
53
54 public static function deleteByPaymentId($paymentId)
55 {
56 if((int)$paymentId > 0)
57 {
58 $con = Main\Application::getConnection();
59 $sqlHelper = $con->getSqlHelper();
60 $strSql = "DELETE FROM ".self::getTableName()." WHERE PAYMENT_ID=".(int)($paymentId);
61 $con->queryExecute($strSql);
62 }
63 }
64}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29