Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 5 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow [WORKING] mosDBTable->move

[WORKING] mosDBTable->move PDF Print E-mail

Last reviewed: Not reviewed


Generic move method. This method may be overloaded/supplemented by the child class as required. This method is used, for example, to implement the move up/down icons in the some of the administrator pages. This method will only work if the database table contains an 'ordering' field.


void move ( signed-int $direction [, string $where ] )

is an integer which defines the increment by which the current record should be moved. If $direction is negative then the record will be moved up the list; otherwise it will be moved down the list.
is an SQL WHERE clause that will be used to select the table records on which to operate. This parameter is optional and if omitted will default to an empty string.



global $database;
// Declare an instance of the content class.
$row = new mosContent( $database );
// Load a given record from the database table.
$row->load( $uid );
// Now move it by $inc positions in the ordering sequence
// and with the given WHERE clause.
$row->move( $inc, "catid = $row->catid AND state >= 0" );

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
< Prev   Next >