Public Member Functions

maxdbSequence Class Reference

Public Member Functions

 __construct ($sequence, $objMax=false, $connection)
 Constructor.
 getSequence ()
 Return named sequence property.
 setSequence ()
 Create sequence object.

Detailed Description

Definition at line 15 of file maxdbSequence.php.


Constructor & Destructor Documentation

__construct ( sequence,
objMax = false,
connection 
)

Constructor.

public

Parameters:
str $sequence
int $objMax
mixed $connection

Definition at line 57 of file maxdbSequence.php.

    {
        $this->objConnection = $connection;
        $this->objMax        = $objMax;
        $this->objSequence   = $sequence;
    }


Member Function Documentation

getSequence (  ) 

Return named sequence property.

public

Returns:
str

Definition at line 70 of file maxdbSequence.php.

    {
        return $this->objSequence . '.NEXTVAL';
    }

setSequence (  ) 

Create sequence object.

public

Returns:
bool

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 );
    }


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