/** * This will create a new record or update an existing record given the MS SQL Data Row * @param string[] $objRow the mssql_fetch_assoc row result from MS SQL Server * @return ParentPagerChildHistory */ public static function CreateOrUpdateForMsSqlRow($objRow) { $intServerIdentifier = $objRow['lngChildHistoryID']; $intIndividualIdentifier = $objRow['lngIndividualID']; $intStationIdentifier = $objRow['lngStationID']; $intPeriodIdentifier = $objRow['lngPeriodID']; $intDropoffIndividualIdentifier = $objRow['lngDropOffByID']; $intPickupIndividualIdentifier = $objRow['lngPickupByID']; $dttDateIn = new QDateTime($objRow['dtmCheckInDateTime']); $dttDateOut = new QDateTime($objRow['dtmCheckOutDateTime']); $objParentPagerChildHistory = ParentPagerChildHistory::LoadByServerIdentifier($intServerIdentifier); if (!$objParentPagerChildHistory) { $objParentPagerChildHistory = new ParentPagerChildHistory(); $objParentPagerChildHistory->ServerIdentifier = $intServerIdentifier; } $objParentPagerChildHistory->ParentPagerIndividual = ParentPagerIndividual::LoadByServerIdentifier($intIndividualIdentifier); $objParentPagerChildHistory->ParentPagerStation = ParentPagerStation::LoadByServerIdentifier($intStationIdentifier); $objParentPagerChildHistory->ParentPagerPeriod = ParentPagerPeriod::LoadByServerIdentifier($intPeriodIdentifier); $objParentPagerChildHistory->DropoffByParentPagerIndividual = ParentPagerIndividual::LoadByServerIdentifier($intDropoffIndividualIdentifier); $objParentPagerChildHistory->PickupByParentPagerIndividual = ParentPagerIndividual::LoadByServerIdentifier($intPickupIndividualIdentifier); $objParentPagerChildHistory->DateIn = $dttDateIn; $objParentPagerChildHistory->DateOut = $dttDateOut; $objParentPagerChildHistory->Save(); return $objParentPagerChildHistory; }
/** * This will create a new record or update an existing record given the MS SQL Data Row * @param string[] $objRow the mssql_fetch_assoc row result from MS SQL Server * @return ParentPagerPeriod */ public static function CreateOrUpdateForMsSqlRow($objRow) { $intServerIdentifier = $objRow['lngPeriodID']; $strName = trim($objRow['strPeriodDesc']); $objParentPagerPeriod = ParentPagerPeriod::LoadByServerIdentifier($intServerIdentifier); if (!$objParentPagerPeriod) { $objParentPagerPeriod = new ParentPagerPeriod(); $objParentPagerPeriod->ServerIdentifier = $intServerIdentifier; } $objParentPagerPeriod->Name = $strName; $objParentPagerPeriod->Save(); return $objParentPagerPeriod; }
/** * This will create a new record or update an existing record given the MS SQL Data Row * @param string[] $objRow the mssql_fetch_assoc row result from MS SQL Server * @return ParentPagerAttendantHistory */ public static function CreateOrUpdateForMsSqlRow($objRow) { $intServerIdentifier = $objRow['lngAttendantHistoryID']; $intIndividualIdentifier = $objRow['lngIndividualID']; $intStationIdentifier = $objRow['lngStationID']; $intPeriodIdentifier = $objRow['lngPeriodID']; $intProgramIdentifier = $objRow['lngProgramID']; $dttDateIn = new QDateTime($objRow['dtmStartDateTime']); $dttDateOut = new QDateTime($objRow['dtmEndDateTime']); $objParentPagerAttendantHistory = ParentPagerAttendantHistory::LoadByServerIdentifier($intServerIdentifier); if (!$objParentPagerAttendantHistory) { $objParentPagerAttendantHistory = new ParentPagerAttendantHistory(); $objParentPagerAttendantHistory->ServerIdentifier = $intServerIdentifier; } $objParentPagerAttendantHistory->ParentPagerIndividual = ParentPagerIndividual::LoadByServerIdentifier($intIndividualIdentifier); $objParentPagerAttendantHistory->ParentPagerStation = ParentPagerStation::LoadByServerIdentifier($intStationIdentifier); $objParentPagerAttendantHistory->ParentPagerPeriod = ParentPagerPeriod::LoadByServerIdentifier($intPeriodIdentifier); $objParentPagerAttendantHistory->ParentPagerProgram = ParentPagerProgram::LoadByServerIdentifier($intProgramIdentifier); $objParentPagerAttendantHistory->DateIn = $dttDateIn; $objParentPagerAttendantHistory->DateOut = $dttDateOut; $objParentPagerAttendantHistory->Save(); return $objParentPagerAttendantHistory; }