コード例 #1
0
    /**
     * Deletes all associated IssueFieldOptions
     * @return void
     */
    public function DeleteAllIssueFieldOptions()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateIssueFieldOption on this unsaved IssueField.');
        }
        // Get the Database Object for this Class
        $objDatabase = IssueField::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (IssueFieldOption::LoadArrayByIssueFieldId($this->intId) as $objIssueFieldOption) {
                $objIssueFieldOption->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`issue_field_option`
				WHERE
					`issue_field_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }