Ejemplo n.º 1
0
 public function calculateId()
 {
     $dc = kDataCenterMgr::getCurrentDc();
     for ($i = 0; $i < 10; $i++) {
         $id = $dc["id"] . '_' . md5(microtime(true));
         $existingObject = UploadTokenPeer::retrieveByPk($id);
         if (!$existingObject) {
             return $id;
         }
     }
     throw new Exception("Could not calculate unique id for upload token");
 }