MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
midgenerator.class
Ir para a documentação deste ficheiro.
1<?php
2
4{
5 private $tableGenerator = "cm_sequence";
6
7 public function getNewId($sequence = 'admin', $tableGenerator = 'cm_sequence')
8 {
9 $this->value = $this->getNextValue($sequence, $tableGenerator);
10 return $this->value;
11 }
12
13 public function getNextValue($sequence = 'admin', $tableGenerator = 'cm_sequence')
14 {
15 $sql = new sql("value", $tableGenerator, "sequence='$sequence'");
16 $query = $this->db->getQuery($sql);
17 $value = $query->fields('value');
18 $sql = new sql("value", $tableGenerator, "sequence='$sequence'");
19 $value++;
20 $this->db->execute($sql->update("$value"));
21 return $value;
22 }
23}
24?>
getNextValue($sequence='admin', $tableGenerator='cm_sequence')
getNewId($sequence='admin', $tableGenerator='cm_sequence')