get('id'), $this->get('bid'), $this->get('booking_id'), $this->get('id_order'), ]; if ($key) { // prepend option value for the given key array_unshift($values, $this->get($key)); } foreach (array_filter($values) as $id) { // do not cast to integer if the booking contains non-number characters return preg_match("/^[0-9]+$/", $id) ? (int)$id : $id; } return 0; } /** * Detects if the options come from a Push notification message posted * by the ServiceWorker to the client application during rendering. * Can also detect if it's a Web Notification payload. * * @param bool $web_or_push true for both, false only for Push. * * @return bool */ public function gotPushData($web_or_push = true) { if ($web_or_push && !$this->get('_push') && !$this->get('_web')) { // not a Push notification, nor a Web notification return false; } if (!$web_or_push && !$this->get('_push')) { // not a Push notification return false; } $title = $this->get('title'); $message = $this->get('message'); return (isset($title) || isset($message)); } }