Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
applang.php
1<?php
2namespace Bitrix\Rest;
3
6
33class AppLangTable extends Main\Entity\DataManager
34{
40 public static function getTableName()
41 {
42 return 'b_rest_app_lang';
43 }
44
50 public static function getMap()
51 {
52 return array(
53 'ID' => array(
54 'data_type' => 'integer',
55 'primary' => true,
56 ),
57 'APP_ID' => array(
58 'data_type' => 'integer',
59 'required' => true,
60 ),
61 'LANGUAGE_ID' => array(
62 'data_type' => 'string',
63 'required' => true,
64 'validation' => array(__CLASS__, 'validateLanguageId'),
65 ),
66 'MENU_NAME' => array(
67 'data_type' => 'string',
68 'validation' => array(__CLASS__, 'validateMenuName'),
69 ),
70 'APP' => array(
71 'data_type' => 'Bitrix\Rest\AppTable',
72 'reference' => array('=this.APP_ID' => 'ref.ID'),
73 ),
74 );
75 }
76
77 public static function deleteByApp($appId)
78 {
79 $connection = Main\Application::getConnection();
80 return $connection->query("DELETE FROM ".static::getTableName()." WHERE APP_ID='".intval($appId)."'");
81 }
82
88 public static function validateLanguageId()
89 {
90 return array(
91 new Main\Entity\Validator\Length(null, 2),
92 );
93 }
94
100 public static function validateMenuName()
101 {
102 return array(
103 new Main\Entity\Validator\Length(null, 500),
104 );
105 }
106
107 public static function onAfterAdd(Main\Entity\Event $event)
108 {
109 EventController::onAddAppLang($event);
110 }
111}
static validateLanguageId()
Definition applang.php:88
static deleteByApp($appId)
Definition applang.php:77
static onAfterAdd(Main\Entity\Event $event)
Definition applang.php:107