id)) { $this->id = $this->id[0] ?? ''; } // Ensure name is a string, not an array if(is_array($this->name)) { $this->name = $this->name[0] ?? ''; } if(isset($data->suffix) && $data->suffix) { $suffix = $data->suffix; if(is_array($suffix)) { $suffix = $suffix[0] ?? ''; } $this->name .= ' ' . $suffix; } if($this->recent && $this->recent) { foreach($this->recent as &$recent) { parent::ConvertToDateTime($recent->starts); parent::ConvertToDateTime($recent->ends); } } if($this->next && $this->next) { foreach($this->next as &$next) { parent::ConvertToDateTime($next->starts); parent::ConvertToDateTime($next->ends); } } if(isset($data->email) && ($mailComma = strpos((string) $data->email, ',')) !== false) { $this->email = substr($data->email, 0, $mailComma); } if(isset($data->state)) { $this->nonstop = $data->state == 0; $this->rerun = $data->state == 3; } $this->url = "/{$this->id}/" . parent::url_slug($this->name ?? ''); } public function isSpecial() { return ($this->priority < 2); } }