コード例 #1
0
ファイル: acs-relationships.cli.php プロジェクト: alcf/chms
            case 'daughter':
                $intRelationshipTypeId = RelationshipType::Child;
                break;
            case 'brother':
            case 'sister':
                $intRelationshipTypeId = RelationshipType::Sibling;
                break;
            case 'grandmother':
            case 'grandfather':
                $intRelationshipTypeId = RelationshipType::Grandparent;
                break;
            case 'grandchild':
            case 'grandson':
            case 'granddaughter':
                $intRelationshipTypeId = RelationshipType::Grandchild;
                break;
        }
        if ($intRelationshipTypeId) {
            $objPerson = Person::Load($intPersonIdByIndvId[$objRow['indvid']]);
            $objRelatedPerson = Person::Load($intPersonIdByIndvId[$objRow['reltindvid']]);
            if (!Relationship::LoadByPersonIdRelatedToPersonId($objPerson->Id, $objRelatedPerson->Id)) {
                $objPerson->AddRelationship($objRelatedPerson, $intRelationshipTypeId);
            }
        }
    }
}
$objParticipationCursor = HouseholdParticipation::QueryCursor(QQ::All());
$intCount = HouseholdParticipation::CountAll();
while (QDataGen::DisplayWhileTask('Recalculating HouseholdParticipation Roles', $intCount) && ($objHouseholdParticipation = HouseholdParticipation::InstantiateCursor($objParticipationCursor))) {
    $objHouseholdParticipation->RefreshRole();
}