Пример #1
0
    /**
     * Deletes all associated ParentPagerChildHistories
     * @return void
     */
    public function DeleteAllParentPagerChildHistories()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateParentPagerChildHistory on this unsaved ParentPagerPeriod.');
        }
        // Get the Database Object for this Class
        $objDatabase = ParentPagerPeriod::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (ParentPagerChildHistory::LoadArrayByParentPagerPeriodId($this->intId) as $objParentPagerChildHistory) {
                $objParentPagerChildHistory->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`parent_pager_child_history`
				WHERE
					`parent_pager_period_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }