public function setSunpassNumber() { $this->table->sunpass = BookproHelper::randomString(5); $this->_db->setQuery('select count(*) from #__bookpro_customer where sunpass LIKE ' . $this->_db->quote($this->table->sunpass)); if ($this->_db->loadResult()) { //sunpass point dupplicate return $this->setSunpassNumber(); } $id_encode = md5($this->id); $this->table->sunpass .= strtoupper($id_encode[0] . substr($id_encode, -1, 1)); return $this->store(); }