/**
  * Gets all associated CustomFieldsAsDefault as an array of CustomField objects
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return CustomField[]
  */
 public function GetCustomFieldAsDefaultArray($objOptionalClauses = null)
 {
     if (is_null($this->intCustomFieldValueId)) {
         return array();
     }
     try {
         return CustomField::LoadArrayByDefaultCustomFieldValueId($this->intCustomFieldValueId, $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
    /**
     * Deletes all associated CustomFieldsAsDefault
     * @return void
     */
    public function DeleteAllCustomFieldsAsDefault()
    {
        if (is_null($this->intCustomFieldValueId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateCustomFieldAsDefault on this unsaved CustomFieldValue.');
        }
        // Get the Database Object for this Class
        $objDatabase = CustomFieldValue::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (CustomField::LoadArrayByDefaultCustomFieldValueId($this->intCustomFieldValueId) as $objCustomField) {
                $objCustomField->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`custom_field`
				WHERE
					`default_custom_field_value_id` = ' . $objDatabase->SqlVariable($this->intCustomFieldValueId) . '
			');
    }