/** * This will save this object's SignupForm instance, * updating only the fields which have had a control created for it. */ public function SaveSignupForm() { try { // Update any fields for controls that have been created if ($this->lstSignupFormType) { $this->objSignupForm->SignupFormTypeId = $this->lstSignupFormType->SelectedValue; } if ($this->lstMinistry) { $this->objSignupForm->MinistryId = $this->lstMinistry->SelectedValue; } if ($this->txtName) { $this->objSignupForm->Name = $this->txtName->Text; } if ($this->txtToken) { $this->objSignupForm->Token = $this->txtToken->Text; } if ($this->chkActiveFlag) { $this->objSignupForm->ActiveFlag = $this->chkActiveFlag->Checked; } if ($this->chkConfidentialFlag) { $this->objSignupForm->ConfidentialFlag = $this->chkConfidentialFlag->Checked; } if ($this->txtDescription) { $this->objSignupForm->Description = $this->txtDescription->Text; } if ($this->txtInformationUrl) { $this->objSignupForm->InformationUrl = $this->txtInformationUrl->Text; } if ($this->txtSupportEmail) { $this->objSignupForm->SupportEmail = $this->txtSupportEmail->Text; } if ($this->txtEmailNotification) { $this->objSignupForm->EmailNotification = $this->txtEmailNotification->Text; } if ($this->chkAllowOtherFlag) { $this->objSignupForm->AllowOtherFlag = $this->chkAllowOtherFlag->Checked; } if ($this->chkAllowMultipleFlag) { $this->objSignupForm->AllowMultipleFlag = $this->chkAllowMultipleFlag->Checked; } if ($this->txtSignupLimit) { $this->objSignupForm->SignupLimit = $this->txtSignupLimit->Text; } if ($this->txtSignupMaleLimit) { $this->objSignupForm->SignupMaleLimit = $this->txtSignupMaleLimit->Text; } if ($this->txtSignupFemaleLimit) { $this->objSignupForm->SignupFemaleLimit = $this->txtSignupFemaleLimit->Text; } if ($this->txtFundingAccount) { $this->objSignupForm->FundingAccount = $this->txtFundingAccount->Text; } if ($this->lstDonationStewardshipFund) { $this->objSignupForm->DonationStewardshipFundId = $this->lstDonationStewardshipFund->SelectedValue; } if ($this->calDateCreated) { $this->objSignupForm->DateCreated = $this->calDateCreated->DateTime; } if ($this->chkLoginNotRequiredFlag) { $this->objSignupForm->LoginNotRequiredFlag = $this->chkLoginNotRequiredFlag->Checked; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstClassMeeting) { $this->objSignupForm->ClassMeeting = ClassMeeting::Load($this->lstClassMeeting->SelectedValue); } if ($this->lstEventSignupForm) { $this->objSignupForm->EventSignupForm = EventSignupForm::Load($this->lstEventSignupForm->SelectedValue); } // Save the SignupForm object $this->objSignupForm->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this EventSignupFormMetaControl * @param integer $intSignupFormId primary key value * @param QMetaControlCreateType $intCreateType rules governing EventSignupForm object creation - defaults to CreateOrEdit * @return EventSignupFormMetaControl */ public static function Create($objParentObject, $intSignupFormId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intSignupFormId)) { $objEventSignupForm = EventSignupForm::Load($intSignupFormId); // EventSignupForm was found -- return it! if ($objEventSignupForm) { return new EventSignupFormMetaControl($objParentObject, $objEventSignupForm); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a EventSignupForm object with PK arguments: ' . $intSignupFormId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new EventSignupFormMetaControl($objParentObject, new EventSignupForm()); }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, EventSignupForm::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
public static function GenerateFormInMinistry(Ministry $objMinistry) { $objSignupForm = new SignupForm(); $objSignupForm->SignupFormTypeId = SignupFormType::Event; $objSignupForm->Ministry = $objMinistry; $objSignupForm->Name = self::GenerateTitle(3, 8); if (rand(0, 2)) { $strToken = strtolower($objSignupForm->Name); $strToken = str_replace(' ', '_', $strToken); if (!SignupForm::LoadByToken($strToken)) { $objSignupForm->Token = $strToken; } } $objSignupForm->ActiveFlag = rand(0, 10); $objSignupForm->Description = self::GenerateContent(rand(1, 3), 8, 20); $objSignupForm->InformationUrl = 'http://www.yahoo.com/'; $objSignupForm->EmailNotification = rand(0, 1) ? 'mike@michaelho.com, mike.ho@alcf.net' : null; $objSignupForm->AllowOtherFlag = rand(0, 1); $objSignupForm->AllowMultipleFlag = rand(0, 1); switch (rand(0, 5)) { case 1: $objSignupForm->SignupLimit = 50; break; case 2: $objSignupForm->SignupMaleLimit = 50; $objSignupForm->SignupFemaleLimit = 50; break; } $objSignupForm->DateCreated = self::GenerateDateTime(self::$SystemStartDate, QDateTime::Now()); $objSignupForm->Save(); $objEventSignupForm = new EventSignupForm(); $objEventSignupForm->SignupForm = $objSignupForm; $objEventSignupForm->DateStart = new QDateTime('2011-06-27 17:00'); $objEventSignupForm->DateEnd = new QDateTime('2011-06-30 12:00'); $objEventSignupForm->Location = 'Camp Hammer, Boulder Creek, CA'; $objEventSignupForm->Save(); // Add form products information // 1: Required Product $intOrderNumber = 1; if (rand(0, 1)) { $objFormProduct = new FormProduct(); $objFormProduct->SignupForm = $objSignupForm; $objFormProduct->FormProductTypeId = FormProductType::Required; $objFormProduct->FormPaymentTypeId = self::GenerateFromArray(array_keys(FormPaymentType::$NameArray)); $objFormProduct->Name = 'Main Registration Fee'; switch ($objFormProduct->FormPaymentTypeId) { case FormPaymentType::DepositRequired: $objFormProduct->Cost = rand(1, 10) * 10; $objFormProduct->Deposit = $objFormProduct->Cost / 2; break; case FormPaymentType::PayInFull: $objFormProduct->Cost = rand(1, 10) * 10; break; case FormPaymentType::Donation: $objFormProduct->FormPaymentTypeId = FormPaymentType::PayInFull; $objFormProduct->Cost = rand(1, 10) * 10; break; } $objFormProduct->OrderNumber = $intOrderNumber; $intOrderNumber++; $objFormProduct->ViewFlag = true; $objFormProduct->MinimumQuantity = 1; $objFormProduct->MaximumQuantity = 1; $objFormProduct->Save(); } // 2: Required w/ Choice Product if (rand(0, 1)) { $arrProduct = array('100' => 'Standard Accommodation', '150' => 'Deluxe Accommodation'); foreach ($arrProduct as $fltAmount => $strName) { $objFormProduct = new FormProduct(); $objFormProduct->SignupForm = $objSignupForm; $objFormProduct->FormProductTypeId = FormProductType::RequiredWithChoice; $objFormProduct->FormPaymentTypeId = FormPaymentType::PayInFull; $objFormProduct->Name = $strName; $objFormProduct->Description = self::GenerateContent(1, 3, 10); $objFormProduct->Cost = $fltAmount; $objFormProduct->OrderNumber = $intOrderNumber; $objFormProduct->MinimumQuantity = 1; $objFormProduct->MaximumQuantity = 1; $intOrderNumber++; $objFormProduct->ViewFlag = true; $objFormProduct->Save(); } } // 3: Optional Product(s) $intProductCount = rand(0, 3); for ($i = 0; $i < $intProductCount; $i++) { $objFormProduct = new FormProduct(); $objFormProduct->SignupForm = $objSignupForm; $objFormProduct->FormProductTypeId = FormProductType::Optional; $objFormProduct->FormPaymentTypeId = FormPaymentType::PayInFull; $objFormProduct->Name = self::GenerateTitle(2, 5); $objFormProduct->Description = self::GenerateContent(1, 3, 10); $objFormProduct->MinimumQuantity = 1; $objFormProduct->MaximumQuantity = rand(1, 3); $objFormProduct->Cost = rand(1, 10) * 5; $objFormProduct->OrderNumber = $intOrderNumber; $intOrderNumber++; $objFormProduct->ViewFlag = true; $objFormProduct->Save(); } // 4: Otpional Donation if (rand(0, 1)) { $objFormProduct = new FormProduct(); $objFormProduct->SignupForm = $objSignupForm; $objFormProduct->FormProductTypeId = FormProductType::Optional; $objFormProduct->FormPaymentTypeId = FormPaymentType::Donation; $objFormProduct->Name = 'Donation'; $objFormProduct->Description = self::GenerateContent(1, 3, 10); $objFormProduct->MinimumQuantity = 1; $objFormProduct->MaximumQuantity = 1; $objFormProduct->OrderNumber = $intOrderNumber; $intOrderNumber++; $objFormProduct->ViewFlag = true; $objFormProduct->Save(); } // Add Form Questions $intOrderNumber = 1; foreach (FormQuestionType::$NameArray as $intFormQuestionTypeId => $strName) { if (rand(0, 1)) { $objFormQuestion = null; } else { $objFormQuestion = new FormQuestion(); $objFormQuestion->SignupForm = $objSignupForm; $objFormQuestion->OrderNumber = $intOrderNumber; $objFormQuestion->FormQuestionTypeId = $intFormQuestionTypeId; $objFormQuestion->RequiredFlag = rand(0, 1); $objFormQuestion->ViewFlag = rand(0, 1); switch ($intFormQuestionTypeId) { case FormQuestionType::SpouseName: $objFormQuestion->ShortDescription = 'Spouse\'s Name'; $objFormQuestion->Question = 'What is your spouse\'s name?'; break; case FormQuestionType::Address: $objFormQuestion->ShortDescription = 'Home Address'; $objFormQuestion->Question = 'What is your address?'; break; case FormQuestionType::Age: $objFormQuestion->ShortDescription = 'Age'; $objFormQuestion->Question = 'How old are you?'; break; case FormQuestionType::DateofBirth: $objFormQuestion->ShortDescription = 'Date of Birth'; $objFormQuestion->Question = 'When were you born'; break; case FormQuestionType::Gender: $objFormQuestion->ShortDescription = 'Gender'; $objFormQuestion->Question = 'What is your gender?'; break; case FormQuestionType::Phone: $objFormQuestion->ShortDescription = 'Phone'; $objFormQuestion->Question = 'What is your phone number?'; break; case FormQuestionType::Email: $objFormQuestion->ShortDescription = 'Email'; $objFormQuestion->Question = 'What is your email address?'; break; case FormQuestionType::ShortText: $objFormQuestion->ShortDescription = 'Foo Bar'; $objFormQuestion->Question = 'What is your foo bar?'; break; case FormQuestionType::LongText: $objFormQuestion->ShortDescription = 'Foo Bar Long'; $objFormQuestion->Question = 'What is your foo bar long?'; break; case FormQuestionType::Number: $objFormQuestion->ShortDescription = 'Number of Baz'; $objFormQuestion->Question = 'How many baz?'; break; case FormQuestionType::YesNo: $objFormQuestion->ShortDescription = 'Blue Color'; $objFormQuestion->Question = 'Is it blue?'; break; case FormQuestionType::SingleSelect: $objFormQuestion->ShortDescription = 'One Item'; $objFormQuestion->Question = 'Which is it?'; $objFormQuestion->Options = "Option One\nOption Two\nOption Three"; break; case FormQuestionType::MultipleSelect: $objFormQuestion->ShortDescription = 'Multiple Item'; $objFormQuestion->Question = 'What are they?'; $objFormQuestion->Options = "Option One\nOption Two\nOption Three"; break; default: throw new QCallerException(sprintf('Invalid intFormQuestionTypeId: %s', $intFormQuestionTypeId)); } $objFormQuestion->Save(); $intPersonCount = rand(self::SignupsPerFormMinimum, self::SignupsPerFormMaximum); for ($i = 0; $i < $intPersonCount; $i++) { $objPerson = null; while (!$objPerson) { $objPerson = Person::Load(rand(1, self::$MaximumPersonId)); if ($objPerson && !$objSignupForm->AllowMultipleFlag && $objSignupForm->IsPersonRegistered($objPerson)) { $objPerson = null; } } $objSignup = new SignupEntry(); $objSignup->SignupForm = $objSignupForm; $objSignup->Person = $objPerson; $objSignup->SignupByPerson = $objPerson; $objSignup->DateCreated = self::GenerateDateTime($objSignupForm->DateCreated, QDateTime::Now()); $objSignup->SignupEntryStatusTypeId = SignupEntryStatusType::Incomplete; $objSignup->InternalNotes = !rand(0, 2) ? self::GenerateContent(1, 5, 10) : null; $objSignup->Save(); // Rqeuired Products foreach ($objSignupForm->GetFormProductArrayByType(FormProductType::Required) as $objFormProduct) { $objSignup->AddProduct($objFormProduct); } // Required with Choice $objArray = $objSignupForm->GetFormProductArrayByType(FormProductType::RequiredWithChoice); if (count($objArray)) { $objSignup->AddProduct(self::GenerateFromArray($objArray)); } // Optionals (including donations) foreach ($objSignupForm->GetFormProductArrayByType(FormProductType::Optional) as $objFormProduct) { if (rand(0, 1)) { if ($objFormProduct->FormPaymentTypeId == FormPaymentType::Donation) { $objSignup->AddProduct($objFormProduct, rand($objFormProduct->MinimumQuantity, $objFormProduct->MaximumQuantity), rand(1, 10) * 10); } else { $objSignup->AddProduct($objFormProduct, rand($objFormProduct->MinimumQuantity, $objFormProduct->MaximumQuantity)); } } } // Payments if (rand(0, 14)) { $objSignup->SignupEntryStatusTypeId = SignupEntryStatusType::Complete; $objSignup->DateSubmitted = new QDateTime($objSignup->DateCreated); $objSignup->DateSubmitted->Minute += 1; $objSignup->Save(); $fltAmount = rand(0, 1) ? $objSignup->AmountTotal : $objSignup->CalculateMinimumDeposit(); $objSignup->AddPayment(SignupPaymentType::CreditCard, $fltAmount, 'DATAGEN1234', new QDateTime($objSignup->DateSubmitted)); } // Create the form answers for each question foreach ($objSignupForm->GetFormQuestionArray(QQ::OrderBy(QQN::FormQuestion()->OrderNumber)) as $objFormQuestion) { if ($objFormQuestion->RequiredFlag || rand(0, 1)) { $objFormAnswer = new FormAnswer(); $objFormAnswer->SignupEntry = $objSignup; $objFormAnswer->FormQuestion = $objFormQuestion; switch ($objFormQuestion->FormQuestionTypeId) { case FormQuestionType::SpouseName: $objFormAnswer->TextValue = 'Spouse Name'; break; case FormQuestionType::Address: $objFormAnswer->TextValue = $objPerson->PrimaryAddressText . ', ' . $objPerson->PrimaryCityText; $objArray = $objPerson->GetHouseholdParticipationArray(); if (count($objArray)) { $objAddress = $objArray[0]->Household->GetCurrentAddress(); if ($objAddress) { $objFormAnswer->AddressId = $objAddress->Id; } else { $objFormAnswer = null; } } else { $objArray = $objPerson->GetAddressArray(); if (count($objArray)) { $objFormAnswer->AddressId = $objArray[0]->Id; } else { $objFormAnswer = null; } } break; case FormQuestionType::Age: $objFormAnswer->IntegerValue = $objPerson->Age; break; case FormQuestionType::DateofBirth: if ($objPerson->DateOfBirth) { $objFormAnswer->DateValue = $objPerson->DateOfBirth; } break; case FormQuestionType::Gender: switch ($objPerson->Gender) { case 'M': $objFormAnswer->BooleanValue = true; $objFormAnswer->TextValue = 'Male'; break; case 'F': $objFormAnswer->BooleanValue = false; $objFormAnswer->TextValue = 'Female'; break; default: $objFormAnswer = null; break; } break; case FormQuestionType::Phone: if (count($objArray = $objPerson->GetPhoneArray())) { $objFormAnswer->TextValue = $objArray[0]->Number; $objFormAnswer->PhoneId = $objArray[0]->Id; } break; case FormQuestionType::Email: if (count($objArray = $objPerson->GetEmailArray())) { $objFormAnswer->TextValue = $objArray[0]->Address; $objFormAnswer->EmailId = $objArray[0]->Id; } break; case FormQuestionType::ShortText: $objFormAnswer->TextValue = 'Foo Bar'; break; case FormQuestionType::LongText: $objFormAnswer->TextValue = 'The quick brown fox jumps over the lazy dog.'; break; case FormQuestionType::Number: $objFormAnswer->IntegerValue = 28; break; case FormQuestionType::YesNo: $objFormAnswer->BooleanValue = rand(0, 1); break; case FormQuestionType::SingleSelect: $objFormAnswer->TextValue = "Option Two"; break; case FormQuestionType::MultipleSelect: $objFormAnswer->TextValue = "Option One\nOption Three"; break; } if ($objFormAnswer) { $objFormAnswer->Save(); } } } } } } }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'SignupFormTypeId': // Gets the value for intSignupFormTypeId (Not Null) // @return integer return $this->intSignupFormTypeId; case 'MinistryId': // Gets the value for intMinistryId (Not Null) // @return integer return $this->intMinistryId; case 'Name': // Gets the value for strName // @return string return $this->strName; case 'Token': // Gets the value for strToken (Unique) // @return string return $this->strToken; case 'ActiveFlag': // Gets the value for blnActiveFlag // @return boolean return $this->blnActiveFlag; case 'ConfidentialFlag': // Gets the value for blnConfidentialFlag // @return boolean return $this->blnConfidentialFlag; case 'Description': // Gets the value for strDescription // @return string return $this->strDescription; case 'InformationUrl': // Gets the value for strInformationUrl // @return string return $this->strInformationUrl; case 'SupportEmail': // Gets the value for strSupportEmail (Not Null) // @return string return $this->strSupportEmail; case 'EmailNotification': // Gets the value for strEmailNotification // @return string return $this->strEmailNotification; case 'AllowOtherFlag': // Gets the value for blnAllowOtherFlag // @return boolean return $this->blnAllowOtherFlag; case 'AllowMultipleFlag': // Gets the value for blnAllowMultipleFlag // @return boolean return $this->blnAllowMultipleFlag; case 'SignupLimit': // Gets the value for intSignupLimit // @return integer return $this->intSignupLimit; case 'SignupMaleLimit': // Gets the value for intSignupMaleLimit // @return integer return $this->intSignupMaleLimit; case 'SignupFemaleLimit': // Gets the value for intSignupFemaleLimit // @return integer return $this->intSignupFemaleLimit; case 'FundingAccount': // Gets the value for strFundingAccount // @return string return $this->strFundingAccount; case 'DonationStewardshipFundId': // Gets the value for intDonationStewardshipFundId // @return integer return $this->intDonationStewardshipFundId; case 'DateCreated': // Gets the value for dttDateCreated (Not Null) // @return QDateTime return $this->dttDateCreated; case 'LoginNotRequiredFlag': // Gets the value for blnLoginNotRequiredFlag // @return boolean return $this->blnLoginNotRequiredFlag; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Ministry': // Gets the value for the Ministry object referenced by intMinistryId (Not Null) // @return Ministry try { if (!$this->objMinistry && !is_null($this->intMinistryId)) { $this->objMinistry = Ministry::Load($this->intMinistryId); } return $this->objMinistry; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'DonationStewardshipFund': // Gets the value for the StewardshipFund object referenced by intDonationStewardshipFundId // @return StewardshipFund try { if (!$this->objDonationStewardshipFund && !is_null($this->intDonationStewardshipFundId)) { $this->objDonationStewardshipFund = StewardshipFund::Load($this->intDonationStewardshipFundId); } return $this->objDonationStewardshipFund; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ClassMeeting': // Gets the value for the ClassMeeting object that uniquely references this SignupForm // by objClassMeeting (Unique) // @return ClassMeeting try { if ($this->objClassMeeting === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objClassMeeting) { $this->objClassMeeting = ClassMeeting::LoadBySignupFormId($this->intId); } return $this->objClassMeeting; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'EventSignupForm': // Gets the value for the EventSignupForm object that uniquely references this SignupForm // by objEventSignupForm (Unique) // @return EventSignupForm try { if ($this->objEventSignupForm === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objEventSignupForm) { $this->objEventSignupForm = EventSignupForm::LoadBySignupFormId($this->intId); } return $this->objEventSignupForm; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_FormProduct': // Gets the value for the private _objFormProduct (Read-Only) // if set due to an expansion on the form_product.signup_form_id reverse relationship // @return FormProduct return $this->_objFormProduct; case '_FormProductArray': // Gets the value for the private _objFormProductArray (Read-Only) // if set due to an ExpandAsArray on the form_product.signup_form_id reverse relationship // @return FormProduct[] return (array) $this->_objFormProductArray; case '_FormQuestion': // Gets the value for the private _objFormQuestion (Read-Only) // if set due to an expansion on the form_question.signup_form_id reverse relationship // @return FormQuestion return $this->_objFormQuestion; case '_FormQuestionArray': // Gets the value for the private _objFormQuestionArray (Read-Only) // if set due to an ExpandAsArray on the form_question.signup_form_id reverse relationship // @return FormQuestion[] return (array) $this->_objFormQuestionArray; case '_SignupEntry': // Gets the value for the private _objSignupEntry (Read-Only) // if set due to an expansion on the signup_entry.signup_form_id reverse relationship // @return SignupEntry return $this->_objSignupEntry; case '_SignupEntryArray': // Gets the value for the private _objSignupEntryArray (Read-Only) // if set due to an ExpandAsArray on the signup_entry.signup_form_id reverse relationship // @return SignupEntry[] return (array) $this->_objSignupEntryArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but * could and should be used by any custom databind methods that would be used for instances of this * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). * * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return void */ public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null) { // Setup input parameters to default values if none passed in if (!$objCondition) { $objCondition = QQ::All(); } $objClauses = $objOptionalClauses ? $objOptionalClauses : array(); // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = EventSignupForm::QueryCount($objCondition, $objClauses); } // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from EventSignupForm, given the clauses above $this->DataSource = EventSignupForm::QueryArray($objCondition, $objClauses); }