本文整理汇总了PHP中Concrete\Core\Page\Page::isCheckedOut方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::isCheckedOut方法的具体用法?PHP Page::isCheckedOut怎么用?PHP Page::isCheckedOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Concrete\Core\Page\Page
的用法示例。
在下文中一共展示了Page::isCheckedOut方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadCollectionEdit
/**
* Loads a page in edit mode.
*
* @param Page $c
* @return bool
*/
public function loadCollectionEdit(&$c)
{
$c->refreshCache();
// can only load one page into edit mode at a time.
if ($c->isCheckedOut()) {
return false;
}
$app = Application::getFacadeApplication();
$db = $app['database']->connection();
$cID = $c->getCollectionID();
// first, we check to see if we have a collection in edit mode. If we do, we relinquish it
$this->unloadCollectionEdit(false);
$q = 'select cIsCheckedOut, cCheckedOutDatetime from Pages where cID = ?';
$r = $db->executeQuery($q, array($cID));
if ($r) {
$row = $r->fetchRow();
if (!$row['cIsCheckedOut']) {
$app['session']->set('editCID', $cID);
$uID = $this->getUserID();
$dh = $app->make('helper/date');
$datetime = $dh->getOverridableNow();
$q2 = 'update Pages set cIsCheckedOut = ?, cCheckedOutUID = ?, cCheckedOutDatetime = ?, cCheckedOutDatetimeLastEdit = ? where cID = ?';
$r2 = $db->executeQuery($q2, array(1, $uID, $datetime, $datetime, $cID));
$c->cIsCheckedOut = 1;
$c->cCheckedOutUID = $uID;
$c->cCheckedOutDatetime = $datetime;
$c->cCheckedOutDatetimeLastEdit = $datetime;
}
}
return true;
}
示例2: isCheckedOut
/**
* checks if the page is checked out, if it is return true.
*
* @return bool
*/
public function isCheckedOut()
{
return parent::isCheckedOut();
}