本文整理匯總了PHP中Fisharebest\Webtrees\GedcomRecord::canShowByType方法的典型用法代碼示例。如果您正苦於以下問題:PHP GedcomRecord::canShowByType方法的具體用法?PHP GedcomRecord::canShowByType怎麽用?PHP GedcomRecord::canShowByType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fisharebest\Webtrees\GedcomRecord
的用法示例。
在下文中一共展示了GedcomRecord::canShowByType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: canShowByType
/**
* Each object type may have its own special rules, and re-implement this function.
*
* @param int $access_level
*
* @return bool
*/
protected function canShowByType($access_level)
{
// Hide media objects if they are attached to private records
$linked_ids = Database::prepare("SELECT l_from FROM `##link` WHERE l_to = ? AND l_file = ?")->execute(array($this->xref, $this->tree->getTreeId()))->fetchOneColumn();
foreach ($linked_ids as $linked_id) {
$linked_record = GedcomRecord::getInstance($linked_id, $this->tree);
if ($linked_record && !$linked_record->canShow($access_level)) {
return false;
}
}
// ... otherwise apply default behaviour
return parent::canShowByType($access_level);
}