Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mailentityoptions.php
1<?php
2
4
7
25{
26 const DIR = 'DIR';
27 const MAILBOX = 'MAILBOX';
28 const MESSAGE = 'MESSAGE';
29
30 public static function add($fields)
31 {
32 try {
33 return parent::add($fields);
34 } catch (\Exception $exception)
35 {
36 //key conflict
37 }
38 }
39
40 public static function deleteList(array $filter)
41 {
42 $entity = static::getEntity();
43 $connection = $entity->getConnection();
44
45 return $connection->query(sprintf(
46 'DELETE FROM %s WHERE %s',
47 $connection->getSqlHelper()->quote($entity->getDbTableName()),
48 ORM\Query\Query::buildFilterSql($entity, $filter)
49 ));
50 }
51
52 public static function getFilePath()
53 {
54 return __FILE__;
55 }
56
57 public static function getTableName()
58 {
59 return 'b_mail_entity_options';
60 }
61
62 public static function getMap()
63 {
64 return array(
65 'MAILBOX_ID' => array(
66 'data_type' => 'integer',
67 'required' => true,
68 'primary' => true,
69 ),
70 'ENTITY_TYPE' => array(
71 'data_type' => 'enum',
72 'values' => array(self::DIR, self::MAILBOX, self::MESSAGE),
73 'required' => true,
74 'primary' => true,
75 ),
76 'ENTITY_ID' => array(
77 'data_type' => 'string',
78 'required' => true,
79 'primary' => true,
80 ),
81 'PROPERTY_NAME' => array(
82 'data_type' => 'string',
83 'required' => true,
84 'primary' => true,
85 ),
86 'VALUE' => array(
87 'data_type' => 'string',
88 ),
89 'DATE_INSERT' => array(
90 'data_type' => 'datetime',
91 ),
92 );
93 }
94}