本文整理汇总了PHP中Relationship::setFromRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::setFromRequest方法的具体用法?PHP Relationship::setFromRequest怎么用?PHP Relationship::setFromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::setFromRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup_edit
function setup_edit()
{
$rel = new Relationship();
$rel->setFromRequest();
if (!$rel->relation->person_id) {
$rel->relation->person_id = -1;
}
$pdao = getPeopleDAO();
if ($rel->person->person_id > 0) {
$dao = getRelationsDAO();
$dao->getRelationshipDetails($rel);
if ($rel->numResults > 0) {
$ret = $rel->results[0];
$pdao->getParents($ret->relation);
}
} else {
$ret = $rel;
}
$pdao->getParents($ret->person);
$dao = getEventDAO();
$e = new Event();
$e->event_id = $ret->event->event_id;
$dao->getEvents($e, Q_REL, true);
if ($e->numResults == 0) {
$e = new Event();
$e->type = MARRIAGE_EVENT;
$ret->event = $e;
} else {
$ret->event = $e->results[0];
}
$ret->event->person->person_id = 'null';
return $ret;
}
示例2: show_relations
function show_relations($per)
{
global $strMarriage, $strRestricted, $strOn, $strAt, $strCertified, $strEdit, $strDelete;
$editable = $per->isEditable();
$search = new Relationship();
$search->setFromRequest();
$dao = getRelationsDAO();
$dao->getRelationshipDetails($search);
$count = 0;
for ($i = 0; $i < $search->numResults; $i++) {
$rel = $search->results[$i];
if (!isset($rel->relation->person_id)) {
continue;
}
if ($i > 0) {
echo "<hr/>";
}
$count++;
echo $rel->relation->getLink();
if ($rel->isViewable()) {
if ($rel->marriage_date != "0000-00-00") {
echo " " . $strOn . " " . $rel->dom;
}
echo $rel->marriage_place->getAtDisplayPlace();
}
if ($rel->marriage_cert == "Y") {
echo " ({$strCertified})";
}
if ($rel->isEditable()) {
echo " (<a href=\"edit.php?func=edit&area=relations&person=" . $rel->person->person_id . "&event=" . $rel->event->event_id . "\">" . $strEdit . "</a>)";
echo " (<a href=\"JavaScript:confirm_delete('" . $rel->relation->getDisplayName() . "', '" . strtolower($strMarriage) . "', 'passthru.php?func=delete&area=marriage&person=" . $rel->person->person_id . "&event=" . $rel->event->event_id . "')\" class=\"delete\">" . $strDelete . "</a>)";
}
insertChildrenLink($rel->person->person_id, $rel->relation->person_id, $rel->person->gender, $rel->isEditable());
}
return $count;
}
示例3: Relationship
<?php
include_once "classes/Relationship.php";
include_once "modules/db/DAOFactory.php";
$peep = new Relationship();
$rel = new Relationship();
$rel->setFromRequest();
$dao = getRelationsDAO();
if (isset($_REQUEST["func"]) && $_REQUEST["func"] == "delete") {
$peep->setFromRequest();
$dao->getRelationshipDetails($peep);
$peep = $peep->results[0];
if (!$peep->isEditable()) {
die(include "inc/forbidden.inc.php");
}
$rel->setFromRequest();
$dao->deleteRelationshipDetails($rel);
} else {
$peep->setFromPost();
$dao->getRelationshipDetails($peep);
$peep = $peep->results[0];
if (!$peep->isEditable()) {
die(include "inc/forbidden.inc.php");
}
if (isset($rel->oldRelation) && $rel->oldRelation != $peep->relation->person_id) {
$old = new PersonDetail();
$old->queryType = Q_IND;
$pdao = getPeopleDAO();
$old->person_id = $rel->oldRelation;
$pdao->getPersonDetails($old);
$old = $old->results[0];