Basiclyあなたがしたいときにいつでも呼び出すことができ、あなたのモデルでは二つの方法、必要があります:あなたは、列がデフォルト値0でchecked_out
と呼ばれる持っている必要があり、すべての最初のチェックなどの項目をマークするに
function checkin()
{
if ($this->_id)
{
$item= & $this->getTable();
if(! $item->checkin($this->_id)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
return false;
}
function checkout($uid = null)
{
if ($this->_id)
{
// Make sure we have a user id to checkout the article with
if (is_null($uid)) {
$user =& JFactory::getUser();
$uid = $user->get('id');
}
// Lets get to it and checkout the thing...
$item= & $this->getTable();
if(!$item->checkout($uid, $this->_id)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return true;
}
return false;
}
を、また、項目がチェックアウトされたときに時間を保存するにはchecked_out_time
が必要です。 お手伝いをしてください。
ありがとう、di3sel。それがまさに私が探しているものです。 – asciimo