Public Member Functions

ingresSequence Class Reference

Public Member Functions

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

Detailed Description

Definition at line 15 of file ingresSequence.php.


Constructor & Destructor Documentation

__construct ( sequence,
objMax,
connection 
)

Constructor.

public

Parameters:
str $sequence
int $objMax
mixed $connection

Definition at line 57 of file ingresSequence.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 ingresSequence.php.

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

setSequence (  ) 

Create sequence object.

public

Returns:
bool

Definition at line 81 of file ingresSequence.php.

    {
        //make sure $this->objMax is an unsigned int > 0
        $objMax = ( is_numeric( $this->objMax ) && $this->objMax > 0 ) ? 'MAXVALUE ' . ( int )$this->objMax : 'NOMAXVALUE';
        $objSeq = 'CREATE SEQUENCE ' . $this->objSequence . ' AS INTEGER START WITH 1 INCREMENT BY 1 ' . $objMax . ' MINVALUE 1';

        return ingres_query( $objSeq, $this->objConnection )
        or trigger_error( ingres_error( $this->objConnection ), E_USER_WARNING );
    }


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