本文整理汇总了PHP中Relationship::isViewable方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::isViewable方法的具体用法?PHP Relationship::isViewable怎么用?PHP Relationship::isViewable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::isViewable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMarriagePlaces
function getMarriagePlaces(&$locations, $person = null)
{
global $tblprefix, $strEvent, $currentRequest;
$pquery = "select relation.event_id," . PersonDetail::getFields("groom", "ng", "bg", "dg") . "," . PersonDetail::getFields("bride", "nb", "bb", "db") . "," . Event::getFields("e") . ", relation.dissolve_date, relation.dissolve_reason," . " DATE_FORMAT(relation.dissolve_date, " . $currentRequest->datefmt . ") AS DOD " . "," . Location::getFields("l") . " FROM " . $tblprefix . "event e" . " JOIN " . $tblprefix . "spouses relation ON relation.event_id=e.event_id" . " JOIN " . $tblprefix . "locations l ON e.location_id=l.location_id " . " LEFT JOIN " . $tblprefix . "people bride ON relation.bride_id = bride.person_id " . " LEFT JOIN " . $tblprefix . "people groom ON relation.groom_id = groom.person_id " . PersonDetail::getJoins("LEFT", "groom", "ng", "bg", "dg") . PersonDetail::getJoins("LEFT", "bride", "nb", "bb", "db") . " WHERE (e.etype = " . BANNS_EVENT . " OR e.etype=" . MARRIAGE_EVENT . ") AND e.location_id is not null";
$pquery .= $this->addPersonRestriction(" AND ", "bg", "dg");
$pquery .= $this->addPersonRestriction(" AND ", "bb", "db");
if ($locations->location_id > 0) {
$pquery .= " AND l.location_id = " . $locations->location_id;
}
$presult = $this->runQuery($pquery, "");
while ($row = $this->getNextRow($presult)) {
$rel = new Relationship();
$rel->person->loadFields($row, L_HEADER, "groom_");
$rel->person->name->loadFields($row, "ng_");
$rel->person->setPermissions();
$rel->relation->loadFields($row, L_HEADER, "bride_");
$rel->relation->name->loadFields($row, "nb_");
$rel->relation->setPermissions();
$rel->loadFields($row);
$rel->event = new Event();
$rel->event->loadFields($row, "e_");
$rel->event->location->loadFields($row, "l_");
$rel->event->location->setPermissions();
$text = $rel->person->getLink() . ' ' . $strEvent[$row["e_etype"]] . ' ' . $rel->relation->getLink() . ' ' . $rel->event->getDate1();
if ($rel->isViewable()) {
$p = $this->createPlace($locations, $rel->event->location, $text);
if ($p != null) {
$p->marriage = true;
}
}
}
$this->freeResultSet($presult);
}