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(
'%^((https://)|(www\.)|(http://))([a-z0-9-].?)+(:[0-9]+)?(/.*)?$%i',$value[
'cta_button_url']);
30 return static::checkButtonText($value) && static::checkUrl($value);
51 return array_merge(parent::getFields(),[
'cta_button_url',
'cta_button_text']);