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