12 private static function checkButtonText($value) : bool
14 return array_key_exists(
'cta_button_text',$value) && in_array($value[
'cta_button_text'],[
15 static::BUTTON_TEXT_BOOK,
16 static::BUTTON_TEXT_RESERVE,
17 static::BUTTON_TEXT_BUY
21 private static function checkUrl($value) : bool
23 return array_key_exists(
'cta_button_url',$value) &&
24 is_string($value[
'cta_button_url']) &&
25 preg_match(static::URL_PATTERN,$value[
'cta_button_url']);
27 private static function checkTitle($value) : bool
29 return array_key_exists(
'title',$value) && is_string($value[
'title']);
31 private static function checkSubtitle($value) : bool
33 return array_key_exists(
'subtitle',$value) && is_string($value[
'subtitle']);
38 return static::checkSubtitle($value) &&
39 static::checkTitle($value) &&
40 static::checkButtonText($value) &&
41 static::checkUrl($value);
46 $value[
'subtitle'] =
"Powered by Bitrix";
68 return array_merge(parent::getFields(),[
'cta_button_url',
'cta_button_text',
'title',
'subtitle']);