public function __construct($type, $title, $url = '') { $this->type = $type; $this->title = $title; if (!$url) { $url = $title; } $this->url = $url; }