[WORKING] mosDBTable->move

Last reviewed: Not reviewed
phpDocumentor

mosDBTable->move

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.

Syntax

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

$direction
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.
$where
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.

Examples

Example:

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 )