Adodb Dokumentation  V5.14 8 Sept 2011
dbQuerySet Klassenreferenz
Klassendiagramm für dbQuerySet:
Zusammengehörigkeiten von dbQuerySet:

Öffentliche Methoden

 dbQuerySet (&$parent, $attributes=NULL)
 _tag_open (&$parser, $tag, $attributes)
 _tag_cdata (&$parser, $cdata)
 _tag_close (&$parser, $tag)
 newQuery ()
 discardQuery ()
 buildQuery ($sql=NULL)
 addQuery ()
 create (&$xmls)
 prefixQuery ($regex, $query, $prefix=NULL)
 dbQuerySet (&$parent, $attributes=NULL)
 _tag_open (&$parser, $tag, $attributes)
 _tag_cdata (&$parser, $cdata)
 _tag_close (&$parser, $tag)
 newQuery ()
 discardQuery ()
 buildQuery ($sql=NULL)
 addQuery ()
 create (&$xmls)
 prefixQuery ($regex, $query, $prefix=NULL)

Datenfelder

 $queries = array()
 $query
 $prefixKey = ''
 $prefixMethod = 'AUTO'

Ausführliche Beschreibung

Definiert in Zeile 960 der Datei adodb-xmlschema.inc.php.


Dokumentation der Elementfunktionen

_tag_cdata ( &$  parser,
cdata 
)

XML Callback to process CDATA elements

Erneute Implementation von dbObject.

Definiert in Zeile 1040 der Datei adodb-xmlschema.inc.php.

                                                {
                switch( $this->currentElement ) {
                        // Line of queryset SQL data
                        case 'QUERY':
                                $this->buildQuery( $cdata );
                                break;
                        default:
                                
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

_tag_cdata ( &$  parser,
cdata 
)

XML Callback to process CDATA elements

Erneute Implementation von dbObject.

Definiert in Zeile 1139 der Datei adodb-xmlschema03.inc.php.

                                                {
                switch( $this->currentElement ) {
                        // Line of queryset SQL data
                        case 'QUERY':
                                $this->buildQuery( $cdata );
                                break;
                        default:
                                
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

_tag_close ( &$  parser,
tag 
)

XML Callback to process end elements

private

Erneute Implementation von dbObject.

Definiert in Zeile 1056 der Datei adodb-xmlschema.inc.php.

                                              {
                $this->currentElement = '';
                
                switch( strtoupper( $tag ) ) {
                        case 'QUERY':
                                // Add the finished query to the open query set.
                                $this->addQuery();
                                break;
                        case 'SQL':
                                $this->parent->addSQL( $this->create( $this->parent ) );
                                xml_set_object( $parser, $this->parent );
                                $this->destroy();
                                break;
                        default:
                                
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

_tag_close ( &$  parser,
tag 
)

XML Callback to process end elements

private

Erneute Implementation von dbObject.

Definiert in Zeile 1155 der Datei adodb-xmlschema03.inc.php.

                                              {
                $this->currentElement = '';
                
                switch( strtoupper( $tag ) ) {
                        case 'QUERY':
                                // Add the finished query to the open query set.
                                $this->addQuery();
                                break;
                        case 'SQL':
                                $this->parent->addSQL( $this->create( $this->parent ) );
                                xml_set_object( $parser, $this->parent );
                                $this->destroy();
                                break;
                        default:
                                
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

_tag_open ( &$  parser,
tag,
attributes 
)

XML Callback to process start elements. Elements currently processed are: QUERY.

private

Erneute Implementation von dbObject.

Definiert in Zeile 1018 der Datei adodb-xmlschema.inc.php.

                                                          {
                $this->currentElement = strtoupper( $tag );
                
                switch( $this->currentElement ) {
                        case 'QUERY':
                                // Create a new query in a SQL queryset.
                                // Ignore this query set if a platform is specified and it's different than the 
                                // current connection platform.
                                if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
                                        $this->newQuery();
                                } else {
                                        $this->discardQuery();
                                }
                                break;
                        default:
                                // print_r( array( $tag, $attributes ) );
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

_tag_open ( &$  parser,
tag,
attributes 
)

XML Callback to process start elements. Elements currently processed are: QUERY.

private

Erneute Implementation von dbObject.

Definiert in Zeile 1117 der Datei adodb-xmlschema03.inc.php.

                                                          {
                $this->currentElement = strtoupper( $tag );
                
                switch( $this->currentElement ) {
                        case 'QUERY':
                                // Create a new query in a SQL queryset.
                                // Ignore this query set if a platform is specified and it's different than the 
                                // current connection platform.
                                if( !isset( $attributes['PLATFORM'] ) OR $this->supportedPlatform( $attributes['PLATFORM'] ) ) {
                                        $this->newQuery();
                                } else {
                                        $this->discardQuery();
                                }
                                break;
                        default:
                                // print_r( array( $tag, $attributes ) );
                }
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

addQuery ( )

Adds a completed query to the query list

Rückgabe:
string SQL of added query

Definiert in Zeile 1117 der Datei adodb-xmlschema.inc.php.

                            {
                if( !isset( $this->query ) ) {
                        return FALSE;
                }
                
                $this->queries[] = $return = trim($this->query);
                
                unset( $this->query );
                
                return $return;
        }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

addQuery ( )

Adds a completed query to the query list

Rückgabe:
string SQL of added query

Definiert in Zeile 1216 der Datei adodb-xmlschema03.inc.php.

                            {
                if( !isset( $this->query ) ) {
                        return FALSE;
                }
                
                $this->queries[] = $return = trim($this->query);
                
                unset( $this->query );
                
                return $return;
        }
buildQuery ( sql = NULL)

Appends a line to a query that is being built line by line

Parameter:
string$dataLine of SQL data or NULL to initialize a new query
Rückgabe:
string SQL query string.

Definiert in Zeile 1102 der Datei adodb-xmlschema.inc.php.

                                           {
                if( !isset( $this->query ) OR empty( $sql ) ) {
                        return FALSE;
                }
                
                $this->query .= $sql;
                
                return $this->query;
        }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

buildQuery ( sql = NULL)

Appends a line to a query that is being built line by line

Parameter:
string$dataLine of SQL data or NULL to initialize a new query
Rückgabe:
string SQL query string.

Definiert in Zeile 1201 der Datei adodb-xmlschema03.inc.php.

                                           {
                if( !isset( $this->query ) OR empty( $sql ) ) {
                        return FALSE;
                }
                
                $this->query .= $sql;
                
                return $this->query;
        }
create ( &$  xmls)

Creates and returns the current query set

Parameter:
object$xmlsadoSchema object
Rückgabe:
array Query set

Erneute Implementation von dbObject.

Definiert in Zeile 1135 der Datei adodb-xmlschema.inc.php.

                                  {
                foreach( $this->queries as $id => $query ) {
                        switch( $this->prefixMethod ) {
                                case 'AUTO':
                                        // Enable auto prefix replacement
                                        
                                        // Process object prefix.
                                        // Evaluate SQL statements to prepend prefix to objects
                                        $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        
                                        // SELECT statements aren't working yet
                                        #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
                                        
                                case 'MANUAL':
                                        // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
                                        // If prefixKey is not set, we use the default constant XMLS_PREFIX
                                        if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
                                                // Enable prefix override
                                                $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
                                        } else {
                                                // Use default replacement
                                                $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
                                        }
                        }
                        
                        $this->queries[$id] = trim( $query );
                }
                
                // Return the query set array
                return $this->queries;
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

create ( &$  xmls)

Creates and returns the current query set

Parameter:
object$xmlsadoSchema object
Rückgabe:
array Query set

Erneute Implementation von dbObject.

Definiert in Zeile 1234 der Datei adodb-xmlschema03.inc.php.

                                  {
                foreach( $this->queries as $id => $query ) {
                        switch( $this->prefixMethod ) {
                                case 'AUTO':
                                        // Enable auto prefix replacement
                                        
                                        // Process object prefix.
                                        // Evaluate SQL statements to prepend prefix to objects
                                        $query = $this->prefixQuery( '/^\s*((?is)INSERT\s+(INTO\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        $query = $this->prefixQuery( '/^\s*((?is)UPDATE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        $query = $this->prefixQuery( '/^\s*((?is)DELETE\s+(FROM\s+)?)((\w+\s*,?\s*)+)(\s.*$)/', $query, $xmls->objectPrefix );
                                        
                                        // SELECT statements aren't working yet
                                        #$data = preg_replace( '/(?ias)(^\s*SELECT\s+.*\s+FROM)\s+(\W\s*,?\s*)+((?i)\s+WHERE.*$)/', "\1 $prefix\2 \3", $data );
                                        
                                case 'MANUAL':
                                        // If prefixKey is set and has a value then we use it to override the default constant XMLS_PREFIX.
                                        // If prefixKey is not set, we use the default constant XMLS_PREFIX
                                        if( isset( $this->prefixKey ) AND( $this->prefixKey !== '' ) ) {
                                                // Enable prefix override
                                                $query = str_replace( $this->prefixKey, $xmls->objectPrefix, $query );
                                        } else {
                                                // Use default replacement
                                                $query = str_replace( XMLS_PREFIX , $xmls->objectPrefix, $query );
                                        }
                        }
                        
                        $this->queries[$id] = trim( $query );
                }
                
                // Return the query set array
                return $this->queries;
        }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

dbQuerySet ( &$  parent,
attributes = NULL 
)

Initializes the query set.

Parameter:
object$parentParent object
array$attributesAttributes

Definiert in Zeile 988 der Datei adodb-xmlschema.inc.php.

                                                            {
                $this->parent = $parent;
                        
                // Overrides the manual prefix key
                if( isset( $attributes['KEY'] ) ) {
                        $this->prefixKey = $attributes['KEY'];
                }
                
                $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
                
                // Enables or disables automatic prefix prepending
                switch( $prefixMethod ) {
                        case 'AUTO':
                                $this->prefixMethod = 'AUTO';
                                break;
                        case 'MANUAL':
                                $this->prefixMethod = 'MANUAL';
                                break;
                        case 'NONE':
                                $this->prefixMethod = 'NONE';
                                break;
                }
        }
dbQuerySet ( &$  parent,
attributes = NULL 
)

Initializes the query set.

Parameter:
object$parentParent object
array$attributesAttributes

Definiert in Zeile 1087 der Datei adodb-xmlschema03.inc.php.

                                                            {
                $this->parent = $parent;
                        
                // Overrides the manual prefix key
                if( isset( $attributes['KEY'] ) ) {
                        $this->prefixKey = $attributes['KEY'];
                }
                
                $prefixMethod = isset( $attributes['PREFIXMETHOD'] ) ? strtoupper( trim( $attributes['PREFIXMETHOD'] ) ) : '';
                
                // Enables or disables automatic prefix prepending
                switch( $prefixMethod ) {
                        case 'AUTO':
                                $this->prefixMethod = 'AUTO';
                                break;
                        case 'MANUAL':
                                $this->prefixMethod = 'MANUAL';
                                break;
                        case 'NONE':
                                $this->prefixMethod = 'NONE';
                                break;
                }
        }

Discards the existing query.

Rückgabe:
boolean TRUE

Definiert in Zeile 1090 der Datei adodb-xmlschema.inc.php.

                                {
                unset( $this->query );
                
                return TRUE;
        }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

Discards the existing query.

Rückgabe:
boolean TRUE

Definiert in Zeile 1189 der Datei adodb-xmlschema03.inc.php.

                                {
                unset( $this->query );
                
                return TRUE;
        }
newQuery ( )

Re-initializes the query.

Rückgabe:
boolean TRUE

Definiert in Zeile 1079 der Datei adodb-xmlschema.inc.php.

                            {
                $this->query = '';
                
                return TRUE;
        }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

newQuery ( )

Re-initializes the query.

Rückgabe:
boolean TRUE

Definiert in Zeile 1178 der Datei adodb-xmlschema03.inc.php.

                            {
                $this->query = '';
                
                return TRUE;
        }
prefixQuery ( regex,
query,
prefix = NULL 
)

Rebuilds the query with the prefix attached to any objects

Parameter:
string$regexRegex used to add prefix
string$querySQL query string
string$prefixPrefix to be appended to tables, indices, etc.
Rückgabe:
string Prefixed SQL query string.

Definiert in Zeile 1177 der Datei adodb-xmlschema.inc.php.

                                                               {
                if( !isset( $prefix ) ) {
                        return $query;
                }
                
                if( preg_match( $regex, $query, $match ) ) {
                        $preamble = $match[1];
                        $postamble = $match[5];
                        $objectList = explode( ',', $match[3] );
                        // $prefix = $prefix . '_';
                        
                        $prefixedList = '';
                        
                        foreach( $objectList as $object ) {
                                if( $prefixedList !== '' ) {
                                        $prefixedList .= ', ';
                                }
                                
                                $prefixedList .= $prefix . trim( $object );
                        }
                        
                        $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
                }
                
                return $query;
        }

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

prefixQuery ( regex,
query,
prefix = NULL 
)

Rebuilds the query with the prefix attached to any objects

Parameter:
string$regexRegex used to add prefix
string$querySQL query string
string$prefixPrefix to be appended to tables, indices, etc.
Rückgabe:
string Prefixed SQL query string.

Definiert in Zeile 1276 der Datei adodb-xmlschema03.inc.php.

                                                               {
                if( !isset( $prefix ) ) {
                        return $query;
                }
                
                if( preg_match( $regex, $query, $match ) ) {
                        $preamble = $match[1];
                        $postamble = $match[5];
                        $objectList = explode( ',', $match[3] );
                        // $prefix = $prefix . '_';
                        
                        $prefixedList = '';
                        
                        foreach( $objectList as $object ) {
                                if( $prefixedList !== '' ) {
                                        $prefixedList .= ', ';
                                }
                                
                                $prefixedList .= $prefix . trim( $object );
                        }
                        
                        $query = $preamble . ' ' . $prefixedList . ' ' . $postamble;
                }
                
                return $query;
        }

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: