private function generateUniqIdsForEmptyOnes($pdo)
    {
        $select = $pdo->query('
SELECT `id`
  FROM `' . Utils::table('vote') . '`
 WHERE `uniqid` = \'\'');
        $update = $pdo->prepare('
UPDATE `' . Utils::table('vote') . '`
   SET `uniqid` = :uniqid
 WHERE `id` = :id');
        while ($row = $select->fetch(\PDO::FETCH_OBJ)) {
            $token = Token::getToken(16);
            $update->execute(['uniqid' => $token, 'id' => $row->id]);
        }
    }
Exemple #2
0
 private function random($length)
 {
     return Token::getToken($length);
 }