本文整理汇总了PHP中Alias::selectByUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::selectByUrl方法的具体用法?PHP Alias::selectByUrl怎么用?PHP Alias::selectByUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::selectByUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearAliases
public function clearAliases()
{
if ($this->id > 0) {
$objContentLangs = ContentLanguage::select();
foreach ($objContentLangs as $objContentLanguage) {
$objAliases = Alias::selectByUrl($this->id, $objContentLanguage->getId());
if (is_object($objAliases)) {
foreach ($objAliases as $objAlias) {
$objAlias->delete();
}
}
}
}
}
示例2: clearAliases
public function clearAliases()
{
if ($this->id > 0) {
//*** Also delete the aliases with language 0 (All languages).
$arrLanguageIds = array(0);
//*** Get the rest of the languages.
$objContentLangs = ContentLanguage::select();
foreach ($objContentLangs as $objContentLanguage) {
array_push($arrLanguageIds, $objContentLanguage->getId());
}
foreach ($arrLanguageIds as $intLanguageId) {
$objAliases = Alias::selectByUrl($this->id, $intLanguageId);
if (is_object($objAliases)) {
foreach ($objAliases as $objAlias) {
$objAlias->delete();
}
}
}
}
}