本文整理汇总了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;
}