error !== null; } protected function get_error_site_params() : array { return [ 'content' => $this->error, 'type' => 'toast-error' ]; } protected function fail( string|\cx_appengine\string_builder $content ) : self { if (!is_string($content)) { $content = $content->get(); } $this->error = __($content, 'cx_newsletter'); return $this; } protected function get_error_template() : \cx_appengine\template { return ( $this ->get_templates() ->prepare('only_toast_site') ); } protected function construct_fail() : self { $this->error = null; return $this; } private ?string $error; }