本文整理汇总了PHP中Library::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Library::update方法的具体用法?PHP Library::update怎么用?PHP Library::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copySearchSourcesFromLibrary
function copySearchSourcesFromLibrary()
{
$libraryId = $_REQUEST['id'];
if (isset($_REQUEST['submit'])) {
$library = new Library();
$library->libraryId = $libraryId;
$library->find(true);
$library->clearSearchSources();
$libraryToCopyFromId = $_REQUEST['libraryToCopyFrom'];
$libraryToCopyFrom = new Library();
$libraryToCopyFrom->libraryId = $libraryToCopyFromId;
$library->find(true);
$searchSourcesToCopy = $libraryToCopyFrom->searchSources;
foreach ($searchSourcesToCopy as $searchKey => $searchSources) {
$searchSources->libraryId = $libraryId;
$searchSources->id = null;
$searchSourcesToCopy[$searchKey] = $searchSources;
}
$library->searchSources = $searchSourcesToCopy;
$library->update();
header("Location: /Admin/Libraries?objectAction=edit&id=" . $libraryId);
} else {
//Prompt user for the library to copy from
$allLibraries = $this->getAllObjects();
unset($allLibraries[$libraryId]);
foreach ($allLibraries as $key => $library) {
if (count($library->searchSources) == 0) {
unset($allLibraries[$key]);
}
}
global $interface;
$interface->assign('allLibraries', $allLibraries);
$interface->assign('id', $libraryId);
$interface->setTemplate('../Admin/copyLibrarySearchSources.tpl');
}
}
示例2: array
$iCompanyId = $_SESSION['sess_iCompanyId'];
$iSGroupId = $_SESSION['sess_iSGroupId'];
$qs = '';
} else {
$qs = '&iCompanyId=' . $iCompanyId . '&iSGroupId=' . $iSGroupId;
}
}
if ($mode == "Add") {
# echo "<pre>"; print_r($_FILES) ; exit;
$redirect_file = "index.php?file=m-libraryadd&mode=" . $mode . "&iLibCategoryId=" . $iLibCategoryId . $qs;
$GeneralObj->checkDuplicate('iLibCategoryId', 'LibraryCategory', array('vCategoryName', 'iSGroupId'), $redirect_file, "Category Already Exists ", $vCategoryName, ' and ');
// $libraryObj->setdCreated($dCreated);
$libraryObj->setiSGroupId($iSGroupId);
$iLibCategoryId = $libraryObj->insert();
$msg = MSG_ADD;
$url = 'index.php?file=Library&AX=Yes' . $qs . '&var_msg=' . $msg;
header("Location:" . $url);
exit;
} else {
if ($mode == "Update") {
$update_sql = "UPDATE Document SET eStatus = '" . $eStatus . "'\n\t\t\tWHERE iLibCategoryId IN(" . $iLibCategoryId . ")";
#echo $update_sql;exit;
$obj->sql_query($update_sql);
$libraryObj->setiSGroupId($iSGroupId);
$libraryObj->update($iLibCategoryId);
$msg = MSG_UPDATE;
$url = 'index.php?file=Library&AX=Yes' . $qs . '&var_msg=' . $msg;
header("Location:" . $url);
exit;
}
}