本文整理匯總了PHP中Companies::setCompanyDefault方法的典型用法代碼示例。如果您正苦於以下問題:PHP Companies::setCompanyDefault方法的具體用法?PHP Companies::setCompanyDefault怎麽用?PHP Companies::setCompanyDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Companies
的用法示例。
在下文中一共展示了Companies::setCompanyDefault方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wizard_siteName
public function wizard_siteName()
{
if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
echo 'CATS has lost your session!';
return;
}
/* Bail out if the user doesn't have SA permissions. */
if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
echo 'You do not have permission to change the site name.';
return;
}
if (isset($_GET['siteName']) && !empty($_GET['siteName'])) {
$siteName = $_GET['siteName'];
} else {
$siteName = '';
}
if ($siteName == 'default_site' || strlen($siteName) <= 0) {
echo 'That is not a valid site name. Please choose a different one.';
return;
}
$site = new Site($this->_siteID);
$site->setName($siteName);
$companies = new Companies($this->_siteID);
$companyIDInternal = $companies->add('Internal Postings', '', '', '', '', '', '', '', '', '', '', '', '', 'Internal postings.', $this->_userID, $this->_userID);
$companies->setCompanyDefault($companyIDInternal);
$_SESSION['CATS']->setSiteName($siteName);
echo 'Ok';
}