[WORKING] mosDBTable->isCheckedOut

Last reviewed: Not reviewed
phpDocumentor

mosDBTable->isCheckedOut

Generic function that tests if the current item is checked out. This method may be overridden/supplemented by the child class as required.

This method was introduced in Joomla 1.0.

See also the mosDBTable->checkin and mosDBTable->checkout methods.

Syntax

boolean isCheckedOut ( [ int $user_id ] )

$user_id
is an optional user id. If omitted (or zero) this function will return true if the current item is checked out or false if not. If a user id is specified then this function will only return true if the current item is checked out by a different user.

Examples

global $database, $my;
 
// Declare an instance of the mosCategory class.
$cat = new mosCategory( $database );
 
// Load record with primary key id 1.
$uid = 1;
if (!$cat->load( $uid )) {
  echo "Cannot load category record $uid: " . $database->stderr();
}
 
// Show some fields from this record.
echo "<br />";
echo "Title: $cat->title<br />";
echo "Description: $cat->description<br />";
 
// Check to see if the record has already beend checked out by someone else.
if ($cat->isCheckedOut( $my->id )) {
  echo "Record $uid is checked out by another user.<br />";
} else {
  echo "Record $uid is not checked out.<br />";
}

Which might output something like this:

Title: Latest
Description: The latest news from the Joomla! Team
Record 1 is not checked out.
 

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

Last Updated ( Monday, 25 December 2006 )