public function id()
 {
     for ($i = 0; $i < 100; $i++) {
         $id = parent::id();
         if ($this->cache->add(__CLASS__ . '/' . $id, 1, 3600)) {
             return $id;
         }
     }
     throw new \Gaia\Exception('unable to allocate new id');
 }
Exemplo n.º 2
0
 public static function newId()
 {
     $creator = new NewId\TimeRand();
     return $creator->id();
 }