Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/*
3
 *  $Id: Sequence.php 7490 2010-03-29 19:53:27Z jwage $
4
 *
5
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
 *
17
 * This software consists of voluntary contributions made by many individuals
18
 * and is licensed under the LGPL. For more information, see
19
 * <http://www.doctrine-project.org>.
20
 */
21
 
22
/**
23
 * Doctrine_Sequence
24
 * The base class for sequence handling drivers.
25
 *
26
 * @package     Doctrine
27
 * @subpackage  Sequence
28
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
29
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
30
 * @link        www.doctrine-project.org
31
 * @since       1.0
32
 * @version     $Revision: 7490 $
33
 */
34
class Doctrine_Sequence extends Doctrine_Connection_Module
35
{
36
    /**
37
     * Returns the next free id of a sequence
38
     *
39
     * @param string $seqName   name of the sequence
40
     * @param bool              when true missing sequences are automatic created
41
     *
42
     * @return integer          next id in the given sequence
43
     * @throws Doctrine_Sequence_Exception
44
     */
45
    public function nextId($seqName, $ondemand = true)
46
    {
47
        throw new Doctrine_Sequence_Exception('method not implemented');
48
    }
49
 
50
    /**
51
     * Returns the autoincrement ID if supported or $id or fetches the current
52
     * ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
53
     *
54
     * @param   string  name of the table into which a new row was inserted
55
     * @param   string  name of the field into which a new row was inserted
56
     */
57
    public function lastInsertId($table = null, $field = null)
58
    {
59
        throw new Doctrine_Sequence_Exception('method not implemented');
60
    }
61
 
62
    /**
63
     * Returns the current id of a sequence
64
     *
65
     * @param string $seqName   name of the sequence
66
     *
67
     * @return integer          current id in the given sequence
68
     */
69
    public function currId($seqName)
70
    {
71
        $this->warnings[] = 'database does not support getting current
72
            sequence value, the sequence value was incremented';
73
        return $this->nextId($seqName);
74
    }
75
}