SQLiteIdGenerator.php

Go to the documentation of this file.
00001 <?php 00002 00003 require_once 'creole/IdGenerator.php'; 00004 00012 class SQLiteIdGenerator implements IdGenerator { 00013 00015 private $conn; 00016 00022 public function __construct(Connection $conn) 00023 { 00024 $this->conn = $conn; 00025 } 00026 00030 public function isBeforeInsert() 00031 { 00032 return false; 00033 } 00034 00038 public function isAfterInsert() 00039 { 00040 return true; 00041 } 00042 00046 public function getIdMethod() 00047 { 00048 return self::AUTOINCREMENT; 00049 } 00050 00054 public function getId($unused = null) 00055 { 00056 return sqlite_last_insert_rowid($this->conn->getResource()); 00057 } 00058 00059 } 00060

This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS