public function __construct ($q = '', $type, $page = 1, $cities = array ()) { if (empty ($type) || empty ($cities)) { throw new Exception ('$type is required!'); } if (empty ($cities)) { $cities = CLUtil::getDefaultCities (); } $this->clVars = array (); $this->q = trim ($q); $this->type = $type; $this->cities = $cities; $this->page = (is_int ($page) && $page > 0) ? $page : 1; $this->parseQ (); $this->clType = CLUtil::getCLType ($this->type); }