예제 #1
0
    /**
     * Deletes an associated SignupEntryAsSignupBy
     * @param SignupEntry $objSignupEntry
     * @return void
     */
    public function DeleteAssociatedSignupEntryAsSignupBy(SignupEntry $objSignupEntry)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupEntryAsSignupBy on this unsaved Person.');
        }
        if (is_null($objSignupEntry->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupEntryAsSignupBy on this Person with an unsaved SignupEntry.');
        }
        // Get the Database Object for this Class
        $objDatabase = Person::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`signup_entry`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objSignupEntry->Id) . ' AND
					`signup_by_person_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objSignupEntry->Journal('DELETE');
        }
    }