本文整理匯總了PHP中Family::LoadByFamily方法的典型用法代碼示例。如果您正苦於以下問題:PHP Family::LoadByFamily方法的具體用法?PHP Family::LoadByFamily怎麽用?PHP Family::LoadByFamily使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Family
的用法示例。
在下文中一共展示了Family::LoadByFamily方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: remove_family
/**
* Remove a family
*
* @param string $passkey
* @param string $strFamily
* @return string
*/
public function remove_family($passkey, $strFamily)
{
if (!$this->check_passkey($passkey)) {
return self::FAIL_AUTH;
}
$family = Family::LoadByFamily($strFamily);
if ($family) {
try {
$family->Delete();
} catch (Exception $e) {
_xls_log("SOAP ERROR : delete family {$strFamily} " . $e);
return self::UNKNOWN_ERROR;
}
}
return self::OK;
}
示例2: add_family
/**
* Add a family
*
* @param string $passkey
* @param string $strFamily
* @return string
* @throws SoapFault
* @soap
*/
public function add_family($passkey, $strFamily)
{
self::check_passkey($passkey);
if (trim($strFamily) == '') {
//ignore blank families
return self::OK;
}
$family = Family::LoadByFamily($strFamily);
if (!$family) {
$family = new Family();
}
$family->family = $strFamily;
$family->request_url = _xls_seo_url($strFamily);
if (!$family->save()) {
$strMsg = "Error saving family {$strFamily}";
Yii::log("SOAP ERROR : {$strMsg} " . print_r($family->getErrors(), true), CLogger::LEVEL_ERROR, 'application.' . __CLASS__ . "." . __FUNCTION__);
throw new SoapFault($strMsg, WsSoapException::ERROR_UNKNOWN);
}
return self::OK;
}