[WORKING] mosDBTable->move

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 )