PgSQLIdGenerator Class Reference

Inheritance diagram for PgSQLIdGenerator:

IdGenerator

List of all members.

Public Member Functions

 __construct (Connection $conn)
 Creates a new IdGenerator class, saves passed connection for use later by getId() method.
 isBeforeInsert ()
 isAfterInsert ()
 getIdMethod ()
 getId ($name=null)

Private Attributes

 $conn
 Connection object that instantiated this class.


Detailed Description

Definition at line 31 of file PgSQLIdGenerator.php.


Constructor & Destructor Documentation

PgSQLIdGenerator::__construct ( Connection conn  ) 

Creates a new IdGenerator class, saves passed connection for use later by getId() method.

Parameters:
Connection $conn

Definition at line 41 of file PgSQLIdGenerator.php.

00042     {
00043         $this->conn = $conn;
00044     }


Member Function Documentation

PgSQLIdGenerator::getId ( name = null  ) 

See also:
IdGenerator::getId()

Implements IdGenerator.

Definition at line 73 of file PgSQLIdGenerator.php.

References ResultSet::FETCHMODE_NUM.

00074     {
00075         if ($name === null) {
00076             throw new SQLException("You must specify the sequence name when calling getId() method.");
00077         }
00078         $rs = $this->conn->executeQuery("SELECT nextval('" . pg_escape_string ( $name ) . "')", ResultSet::FETCHMODE_NUM);
00079         $rs->next();
00080         return $rs->getInt(1);
00081     }

PgSQLIdGenerator::getIdMethod (  ) 

See also:
IdGenerator::getIdMethod()

Implements IdGenerator.

Definition at line 65 of file PgSQLIdGenerator.php.

00066     {
00067         return self::SEQUENCE;
00068     }

PgSQLIdGenerator::isAfterInsert (  ) 

See also:
IdGenerator::isAfterInsert()

Implements IdGenerator.

Definition at line 57 of file PgSQLIdGenerator.php.

00058     {
00059         return false;
00060     }

PgSQLIdGenerator::isBeforeInsert (  ) 

See also:
IdGenerator::isBeforeInsert()

Implements IdGenerator.

Definition at line 49 of file PgSQLIdGenerator.php.

00050     {
00051         return true;
00052     }    


Member Data Documentation

PgSQLIdGenerator::$conn [private]

Connection object that instantiated this class.

Definition at line 34 of file PgSQLIdGenerator.php.


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8