API15

API15:JQuery/ toString

From Joomla! Documentation

Revision as of 22:15, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== string The completed query <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

string The completed query


[Edit Descripton]

Template:Description:JQuery/ toString

Syntax

__toString()


Returns

string The completed query

Defined in

libraries/joomla/database/query.php

Importing

jimport( 'joomla.database.query' );

Source Body

public function __toString()
{
        $query = '';

        switch ($this->_type)
        {
                case 'select':
                        $query .= $this->_select->toString();
                        $query .= $this->_from->toString();
                        if ($this->_join) {
                                // special case for joins
                                foreach ($this->_join as $join) {
                                        $query .= $join->toString();
                                }
                        }
                        if ($this->_where) {
                                $query .= $this->_where->toString();
                        }
                        if ($this->_group) {
                                $query .= $this->_group->toString();
                        }
                        if ($this->_having) {
                                $query .= $this->_having->toString();
                        }
                        if ($this->_order) {
                                $query .= $this->_order->toString();
                        }
                        break;
        }

        return $query;
}

[Edit See Also] Template:SeeAlso:JQuery/ toString

Examples

<CodeExamplesForm />