SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 82 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


$table->load($id);
$user =& JFactory::getUser();
if (!$table->checkout($user->get('id')))
{
// handle failed to checkout record
}
Now that we have a checked-out record, we need to know how to check it in. To do
this we use the checkin() method. This example checks in a record; this will set the
checked_out_time field to a null date:
$table->load($id);
$user =& JFactory::getUser();
if (!$table->checkin($user->get('id')))
{
// handle failed to checkin record
}
We should only check records in and out for logged in users. For a
more comprehensive check-out system use Joomla!'s access control
system explained in Chapter 11.
Ordering
When we want to order items, JTable gives us a number of useful methods. The first
one of these we will look at is reorder(). This method looks at each record and
moves them up the order chain until any gaps in the order have been removed. In
this example, we reorder our table:
$table->reorder();
Very simple, but for more complicated tables there could be groupings within the
records.


Pages:
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6