本文整理匯總了PHP中CProject::setId方法的典型用法代碼示例。如果您正苦於以下問題:PHP CProject::setId方法的具體用法?PHP CProject::setId怎麽用?PHP CProject::setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CProject
的用法示例。
在下文中一共展示了CProject::setId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: die
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
// @todo convert to template
$object_id = (int) w2PgetParam($_GET, 'project_id', 0);
$company_id = (int) w2PgetParam($_GET, 'company_id', $AppUI->user_company);
$contact_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$object = new CProject();
$object->setId($object_id);
$obj = $object;
$canAddEdit = $obj->canAddEdit();
$canAuthor = $obj->canCreate();
$canEdit = $obj->canEdit();
if (!$canAddEdit) {
$AppUI->redirect(ACCESS_DENIED);
}
$obj = $AppUI->restoreObject();
if ($obj) {
$object = $obj;
$object_id = $object->getId();
} else {
$object->loadFull(null, $object_id);
}
if (!$object && $object_id > 0) {
$AppUI->setMsg('Project');
$AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
$AppUI->redirect('m=' . $m);
}
global $AppUI, $cal_sdf;