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 12 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->isCheckedOut

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

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 )
 
< Prev   Next >