[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/creole/ -> IdGenerator.php (source)

   1  <?php
   2  
   3  /**
   4   * Interface for classes that provide functionality to get SEQUENCE or AUTO-INCREMENT ids from the database.
   5   *
   6   * @author    Hans Lellelid <hans@xmpl.org>
   7   * @version   $Revision: 1.3 $
   8   * @package   creole
   9   */
  10  interface IdGenerator {
  11      
  12      /** SEQUENCE id generator type */
  13      const SEQUENCE = 1;
  14      
  15      /** AUTO INCREMENT id generator type */
  16      const AUTOINCREMENT = 2;                
  17      
  18      /**
  19       * Convenience method that returns TRUE if id is generated
  20       * before an INSERT statement.  This is the same as checking
  21       * whether the generator type is SEQUENCE.
  22       * @return boolean TRUE if gen id method is SEQUENCE
  23       * @see getIdMethod()
  24       */
  25      public function isBeforeInsert();
  26      
  27      /**
  28       * Convenience method that returns TRUE if id is generated
  29       * after an INSERT statement.  This is the same as checking
  30       * whether the generator type is AUTOINCREMENT.
  31       * @return boolean TRUE if gen id method is AUTOINCREMENT
  32       * @see getIdMethod()
  33       */
  34      public function isAfterInsert();
  35      
  36      /**
  37       * Get the preferred type / style for generating ids for RDBMS.
  38       * @return int SEQUENCE or AUTOINCREMENT
  39       */
  40      public function getIdMethod();
  41      
  42      /**
  43       * Get the autoincrement or sequence id given the current connection
  44       * and any additional needed info (e.g. sequence name for sequences).
  45       * <p>
  46       * Note: if you take advantage of the fact that $keyInfo may not be specified
  47       * you should make sure that your code is setup in such a way that it will
  48       * be portable if you change from an RDBMS that uses AUTOINCREMENT to one that
  49       * uses SEQUENCE (i.e. in which case you would need to specify sequence name).
  50       * 
  51       * @param mixed $keyInfo Any additional information (e.g. sequence name) needed to fetch the id.
  52       * @return int The last id / next id.
  53       */
  54      public function getId($keyInfo = null);
  55      
  56  }
  57  


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7