Public Member Functions | |
| __construct ($sequence, $objMax=false, $connection) | |
| Constructor. | |
| getSequence () | |
| Return named sequence property. | |
| setSequence () | |
| Create sequence object. | |
Definition at line 15 of file maxdbSequence.php.
| __construct | ( | $ | sequence, | |
| $ | objMax = false, |
|||
| $ | connection | |||
| ) |
Constructor.
public
| str | $sequence | |
| int | $objMax | |
| mixed | $connection |
Definition at line 57 of file maxdbSequence.php.
{
$this->objConnection = $connection;
$this->objMax = $objMax;
$this->objSequence = $sequence;
}
| getSequence | ( | ) |
Return named sequence property.
public
Definition at line 70 of file maxdbSequence.php.
{
return $this->objSequence . '.NEXTVAL';
}
| setSequence | ( | ) |
Create sequence object.
public
Definition at line 81 of file maxdbSequence.php.
{
//make sure $this->objMax is an unsigned int > 0
$objMax = ( is_numeric( $this->objMax ) && $this->objMax > 0 ) ? ' MAXVALUE ' . ( int )$this->objMax : '';
$objSeq = 'CREATE SEQUENCE ' . strtoupper( $this->objSequence ) . ' INCREMENT BY 1 START WITH 1 MINVALUE 1' . $objMax;
return maxdb_query( $this->objConnection, $objSeq )
or trigger_error( maxdb_error( $this->objConnection ), E_USER_WARNING );
}
1.7.1