Actions

API16

Difference between revisions of "JDatabaseQuery/ toString"

From Joomla! Documentation

< API16:JDatabaseQuery
(New page: ===Description=== string The completed query <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</...)
 
m (removing red link to edit, no existant pages)
 
Line 4: Line 4:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JDatabaseQuery/__toString|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JDatabaseQuery/__toString}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 81: Line 81:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JDatabaseQuery/__toString|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JDatabaseQuery/__toString}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 96: Line 96:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Latest revision as of 22:02, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

string The completed query


[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

__toString()


Returns

string The completed query

Defined in

libraries/joomla/database/databasequery.php

Importing

jimport( 'joomla.database.databasequery' );

Source Body

public function __toString()
{
        $query = '';
 
        switch ($this->_type) {
                case 'select':
                        $query .= (string) $this->_select;
                        $query .= (string) $this->_from;
                        if ($this->_join) {
                                // special case for joins
                                foreach ($this->_join as $join) {
                                        $query .= (string) $join;
                                }
                        }
                        if ($this->_where) {
                                $query .= (string) $this->_where;
                        }
                        if ($this->_group) {
                                $query .= (string) $this->_group;
                        }
                        if ($this->_having) {
                                $query .= (string) $this->_having;
                        }
                        if ($this->_order) {
                                $query .= (string) $this->_order;
                        }
                        break;
 
                case 'delete':
                        $query .= (string) $this->_delete;
                        $query .= (string) $this->_from;
                        if ($this->_where) {
                                $query .= (string) $this->_where;
                        }
                        break;
 
                case 'update':
                        $query .= (string) $this->_update;
                        $query .= (string) $this->_set;
                        if ($this->_where) {
                                $query .= (string) $this->_where;
                        }
                        break;
 
                case 'insert':
                        $query .= (string) $this->_insert;
                        $query .= (string) $this->_set;
                        if ($this->_where) {
                                $query .= (string) $this->_where;
                        }
                        break;
        }
 
        return $query;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />