本文整理匯總了PHP中ArtefactType::attached_id_list方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArtefactType::attached_id_list方法的具體用法?PHP ArtefactType::attached_id_list怎麽用?PHP ArtefactType::attached_id_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArtefactType
的用法示例。
在下文中一共展示了ArtefactType::attached_id_list方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: artefact_get_parents_for_cache
function artefact_get_parents_for_cache($artefactid, &$parentids = false)
{
$current = $artefactid;
if (empty($parentids)) {
// first call
$parentids = array();
}
while (true) {
if (!($parent = get_record('artefact', 'id', $current))) {
break;
}
// get any blog posts it may be attached to
if (($parent->artefacttype == 'file' || $parent->artefacttype == 'image') && ($associated = ArtefactType::attached_id_list($parent->id))) {
foreach ($associated as $a) {
$parentids[$a] = 1;
artefact_get_parents_for_cache($a, $parentids);
}
}
if (!$parent->parent) {
break;
}
$parentids[$parent->parent] = 1;
$current = $parent->parent;
}
return $parentids;
}