Example #1
0
 static function from_code($code)
 {
     $url_id = base62::decode($code);
     $url = Doctrine::getTable("url");
     $tbl_user = $url->find($url_id);
     if ($tbl_user == null) {
         throw new Exception("Code Not Found");
     }
     return self::from_type($tbl_user->type, $tbl_user->url, $tbl_user);
 }
Example #2
0
 function insert_into_table()
 {
     $this->tbl->domain = $this->get_domain($this->tbl->url);
     $this->tbl->status = "live";
     $this->tbl->type = $this->type;
     $this->tbl->save();
     $this->tbl->code = base62::encode($this->tbl->id);
     $this->tbl->save();
     $own = new Ownership();
     $own->url_id = $this->tbl->id;
     $own->user_id = 1;
     //TODO: basepage user_id'den gelecek...
     $own->created_by = $this->get_ip();
     $visitor->created_on = date('Y-m-d H:i:s');
     $own->save();
 }