75 'data_type' =>
'integer',
77 'autocomplete' =>
true
79 'ENTITY_TYPE' => array(
80 'data_type' =>
'string',
83 self::ENTITY_TYPE_APPLICATION,
84 self::ENTITY_TYPE_WEBHOOK
86 'validation' => array(
92 'data_type' =>
'integer',
95 'ENTITY_CODE' => array(
96 'data_type' =>
'string',
97 'validation' => array(
102 'SUB_ENTITY_TYPE' => array(
103 'data_type' =>
'string',
105 self::SUB_ENTITY_TYPE_METHOD,
106 self::SUB_ENTITY_TYPE_EVENT,
107 self::SUB_ENTITY_TYPE_PLACEMENT,
108 self::SUB_ENTITY_TYPE_ROBOT,
109 self::SUB_ENTITY_TYPE_BIZ_PROC,
110 self::SUB_ENTITY_TYPE_ACTIVITY,
111 self::SUB_ENTITY_TYPE_CONFIGURATION,
112 self::SUB_ENTITY_TYPE_SEND_MESSAGE,
113 self::SUB_ENTITY_TYPE_LANDING,
114 self::SUB_ENTITY_TYPE_LANDING_KNOWLEDGE,
115 self::SUB_ENTITY_TYPE_BI_SUPERSET,
117 'validation' => array(
119 'validateSubEntityType'
122 'SUB_ENTITY_NAME' => array(
123 'data_type' =>
'string',
124 'validation' => array(
126 'validateSubEntityName'
171 public static function register($entityType, $entityId, $subEntityType, $subEntityName)
173 $entity = static::getEntityInfo($entityType, $entityId);
175 $getListParameters = [
177 '=ENTITY_TYPE' => $entityType,
178 '=ENTITY_ID' => $entity[
'ENTITY_ID'],
179 '=SUB_ENTITY_TYPE' => $subEntityType,
180 '=SUB_ENTITY_NAME' => $subEntityName,
188 $res = static::getList($getListParameters);
189 $element = $res->fetch();
192 return $element[
'ID'];
196 'ENTITY_TYPE' => $entityType,
197 'ENTITY_ID' => $entity[
'ENTITY_ID'],
198 'ENTITY_CODE' => $entity[
'ENTITY_CODE'],
199 'SUB_ENTITY_TYPE' => $subEntityType,
200 'SUB_ENTITY_NAME' => $subEntityName
205 $res = static::add($newEntity);
206 return $res->isSuccess() ? $res->getId() :
false;
210 if (mb_strpos($e->getMessage(),
'Duplicate entry') !==
false)
213 $res = static::getList($getListParameters);
214 $element = $res->fetch();
217 return $element[
'ID'];