11 private static function checkButtonText($value) : bool
13 return array_key_exists(
'cta_button_text',$value) && in_array($value[
'cta_button_text'],[
14 static::BUTTON_TEXT_BOOK,
15 static::BUTTON_TEXT_RESERVE,
16 static::BUTTON_TEXT_BUY
20 private static function checkUrl($value) : bool
22 return array_key_exists(
'cta_button_url',$value) &&
23 is_string($value[
'cta_button_url']) &&
24 preg_match(static::URL_PATTERN,$value[
'cta_button_url']);
26 private static function checkBelowButtonText($value)
28 return array_key_exists(
'below_button_text',$value) && is_string($value[
'below_button_text']);
33 return static::checkBelowButtonText($value) && static::checkButtonText($value) && static::checkUrl($value);
38 $value[
'below_button_text'] =
"Powered by Bitrix";
60 return array_merge(parent::getFields(),[
'cta_button_url',
'cta_button_text',
'below_button_text']);