本文整理汇总了PHP中CSejour::loadBackRefs方法的典型用法代码示例。如果您正苦于以下问题:PHP CSejour::loadBackRefs方法的具体用法?PHP CSejour::loadBackRefs怎么用?PHP CSejour::loadBackRefs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSejour
的用法示例。
在下文中一共展示了CSejour::loadBackRefs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CSejour
$crequest->addWhereClause("sejour.entree", "> '{$date}'");
$crequest->addGroup(array("`sejour_id`"));
$crequest->addHaving(array("COUNT(`sejour`.`sejour_id`)>1"));
$sejour = new CSejour();
$ds = $sejour->getDS();
$list_id_sejour = $ds->loadList($crequest->makeSelect());
usort($list_id_sejour, function ($a, $b) {
return -strnatcmp($a["sortie"], $b["sortie"]);
});
$list_sejour = array();
$patients = array();
$guesses = array();
foreach ($list_id_sejour as $_id_sejour) {
$sejour = new CSejour();
$sejour->load($_id_sejour["sejour_id"]);
$sejour->loadBackRefs("rpu");
$sejour->loadRefPatient();
$sejour->loadNDA();
if (!isset($patients[$sejour->patient_id])) {
$patients["{$sejour->patient_id}"] = $sejour->_ref_patient;
}
$patients["{$sejour->patient_id}"]->_ref_sejours[$sejour->_id] = $sejour;
}
$mergeables_count = 0;
foreach ($patients as $patient_id => $patient) {
$patient->loadIPP();
$guess = array();
$nicer = array();
$guess["mergeable"] = isset($guesses[$patient_id]) ? true : false;
// Sibling patients
$siblings = $patient->getSiblings();
示例2: foreach
$lits = CMbObject::massLoadFwdRef($affectations, "lit_id");
CMbObject::massLoadFwdRef($lits, "chambre_id");
foreach ($affectations as $_affectation) {
$_affectation->loadRefLit()->loadCompleteView();
$_affectation->_rowspan = CMbDT::daysRelative($_affectation->entree, $_affectation->sortie) + 1;
$date_temp = CMbDT::date($_affectation->entree);
while ($date_temp <= CMbDT::date($_affectation->sortie)) {
$dates[$date_temp] = $_affectation->_id;
$date_temp = CMbDT::date("+1 day", $date_temp);
}
}
}
// Gestion des liaisons hors séjour
$dates_after = array();
/** @var CItemLiaison[] $items_liaisons */
$items_liaisons = $sejour->loadBackRefs("items_liaisons");
CMbObject::massLoadFwdRef($items_liaisons, "item_souhait_id");
CMbObject::massLoadFwdRef($items_liaisons, "item_realise_id");
CMbObject::massLoadFwdRef($items_liaisons, "sous_item_id");
foreach ($items_liaisons as $_item_liaison) {
if ($_item_liaison->date > CMbDT::date($sejour->sortie)) {
$dates_after[] = CMbDT::date($_item_liaison->date);
}
$_item = $_item_liaison->loadRefItem();
$_item_liaison->loadRefItemRealise();
if (!$_item->_id) {
$_item = $_item_liaison->_ref_item_realise;
}
$_item_liaison->loadRefSousItem();
switch ($_item->object_class) {
case "CPrestationJournaliere":
示例3: getAllRHSsFor
/**
* Get all possible and existing RHS for given sejour, by date as keys
*
* @param CSejour $sejour Sejour
*
* @return CRHS[],null Null if not applyable
*/
static function getAllRHSsFor(CSejour $sejour)
{
if (!$sejour->_id || $sejour->type != "ssr") {
return null;
}
$rhss = array();
/** @var CRHS $_rhs */
foreach ($sejour->loadBackRefs("rhss") as $_rhs) {
$rhss[$_rhs->date_monday] = $_rhs;
}
for ($date_monday = CMbDT::date("last sunday + 1 day", $sejour->_entree); $date_monday <= $sejour->_sortie; $date_monday = CMbDT::date("+1 week", $date_monday)) {
if (!isset($rhss[$date_monday])) {
$rhs = new CRHS();
$rhs->sejour_id = $sejour->_id;
$rhs->date_monday = $date_monday;
$rhs->updateFormFields();
$rhss[$date_monday] = $rhs;
}
}
ksort($rhss);
return $rhss;
}