API15

Difference between revisions of "JTable/getNextOrder"

From Joomla! Documentation

< API15:JTable
(New page: ===Description=== Returns the ordering value to place a new item last in its group <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JTable/getNextOrde...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JTable/getNextOrder|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JTable/getNextOrder}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 54: Line 54:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JTable/getNextOrder|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JTable/getNextOrder}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 69: Line 69:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Revision as of 13:52, 12 May 2013

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Returns the ordering value to place a new item last in its group

[<! removed edit link to red link >]

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

Syntax[edit]

getNextOrder($where='')
Parameter Name Default Value Description
$where query WHERE clause for selecting MAX(ordering).

Defined in[edit]

libraries/joomla/database/table.php

Importing[edit]

jimport( 'joomla.database.table' );

Source Body[edit]

function getNextOrder ( $where='' )
{
        if (!in_array( 'ordering', array_keys($this->getProperties()) ))
        {
                $this->setError( get_class( $this ).' does not support ordering' );
                return false;
        }

        $query = 'SELECT MAX(ordering)' .
                        ' FROM ' . $this->_tbl .
                        ($where ? ' WHERE '.$where : '');

        $this->_db->setQuery( $query );
        $maxord = $this->_db->loadResult();

        if ($this->_db->getErrorNum())
        {
                $this->setError($this->_db->getErrorMsg());
                return false;
        }
        return $maxord + 1;
}

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

Examples[edit]

<CodeExamplesForm />