Exemplo n.º 1
0
    /**
     * Deletes all associated ParentPagerAttendantHistories
     * @return void
     */
    public function DeleteAllParentPagerAttendantHistories()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateParentPagerAttendantHistory on this unsaved ParentPagerProgram.');
        }
        // Get the Database Object for this Class
        $objDatabase = ParentPagerProgram::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (ParentPagerAttendantHistory::LoadArrayByParentPagerProgramId($this->intId) as $objParentPagerAttendantHistory) {
                $objParentPagerAttendantHistory->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`parent_pager_attendant_history`
				WHERE
					`parent_pager_program_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }