Beispiel #1
0
    /**
     * Deletes all associated ClassRegistrations
     * @return void
     */
    public function DeleteAllClassRegistrations()
    {
        if (is_null($this->intSignupFormId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateClassRegistration on this unsaved ClassMeeting.');
        }
        // Get the Database Object for this Class
        $objDatabase = ClassMeeting::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (ClassRegistration::LoadArrayByClassMeetingId($this->intSignupFormId) as $objClassRegistration) {
                $objClassRegistration->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`class_registration`
				WHERE
					`class_meeting_id` = ' . $objDatabase->SqlVariable($this->intSignupFormId) . '
			');
    }