Class: Doctrine_Sequence_Db2

Source Location: /Doctrine/Sequence/Db2.php

Class Doctrine_Sequence_Db2

Class Overview

Doctrine_Sequence_Db2

Located in /Doctrine/Sequence/Db2.php [line 33]

Doctrine_Connection_Module
   |
   --Doctrine_Sequence
      |
      --Doctrine_Sequence_Db2
Author(s): Information Tags:
Version:  $Revision: 1722 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Doctrine_Connection_Module

Doctrine_Connection_Module::$conn
Doctrine_Connection_Module::$moduleName

Inherited From Doctrine_Sequence

Doctrine_Sequence::currId()
Returns the current id of a sequence
Doctrine_Sequence::lastInsertId()
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
Doctrine_Sequence::nextId()
Returns the next free id of a sequence

Inherited From Doctrine_Connection_Module

Doctrine_Connection_Module::__construct()
Doctrine_Connection_Module::getConnection()
getConnection returns the connection object this module uses
Doctrine_Connection_Module::getModuleName()
getModuleName returns the name of this module

[ Top ]
Method Summary
integer   lastInsertId()   Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
integer   lastSequenceId()   Return the most recent value from the specified sequence in the database.
integer   nextSequenceId()   Generate a new value from the specified sequence in the database, and return it.

[ Top ]
Properties
Methods
lastInsertId  [line 101]

  integer lastInsertId( [string $tableName = null], [string $primaryKey = null]  )

Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.

As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.

The IDENTITY_VAL_LOCAL() function gives the last generated identity value in the current process, even if it was for a GENERATED column.

Parameters:
string   $tableName:  OPTIONAL
string   $primaryKey:  OPTIONAL

API Tags:
Access:  public

Information Tags:
Throws:  Doctrine_Adapter_Db2_Exception

Redefinition of:
Doctrine_Sequence::lastInsertId()
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)

[ Top ]
lastSequenceId  [line 44]

  integer lastSequenceId( string $sequenceName  )

Return the most recent value from the specified sequence in the database.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

Parameters:
string   $sequenceName: 

API Tags:
Access:  public

Information Tags:
Throws:  Doctrine_Adapter_Db2_Exception

[ Top ]
nextSequenceId  [line 68]

  integer nextSequenceId( string $sequenceName  )

Generate a new value from the specified sequence in the database, and return it.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

Parameters:
string   $sequenceName: 

API Tags:
Access:  public

Information Tags:
Throws:  Doctrine_Adapter_Db2_Exception

[ Top ]