本文整理汇总了PHP中QQN::FormProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::FormProduct方法的具体用法?PHP QQN::FormProduct怎么用?PHP QQN::FormProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQN
的用法示例。
在下文中一共展示了QQN::FormProduct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MoveDown
public function MoveDown()
{
$blnFound = false;
foreach (FormProduct::LoadArrayBySignupFormIdFormProductTypeId($this->intSignupFormId, $this->intFormProductTypeId, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objFormProduct) {
if ($blnFound) {
break;
}
if ($objFormProduct->Id == $this->Id) {
$blnFound = true;
}
}
$this->OrderNumber++;
$this->Save();
if ($objFormProduct) {
$objFormProduct->OrderNumber--;
$objFormProduct->Save();
}
self::RefreshOrderNumber($this->intSignupFormId, $this->intFormProductTypeId);
}
示例2: dtgProducts_Bind
public function dtgProducts_Bind()
{
$arrDataSource = array();
// First add any required products
foreach ($this->objSignupForm->GetFormProductArrayByType(FormProductType::Required, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objProduct) {
if ($objProduct->IsAvailableRightNow()) {
$arrDataSource[] = $objProduct;
}
}
// If there are any valid "Required with Choice" products, add the row for it
foreach ($this->objSignupForm->GetFormProductArrayByType(FormProductType::RequiredWithChoice, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objProduct) {
if ($objProduct->IsAvailableRightNow()) {
$arrDataSource[] = -1;
break;
}
}
// Add any optional products
foreach ($this->objSignupForm->GetFormProductArrayByType(FormProductType::Optional, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objProduct) {
if ($objProduct->IsAvailableRightNow()) {
$arrDataSource[] = $objProduct;
}
}
// Add any payments
$arrDataSource = array_merge($arrDataSource, $this->objSignupEntry->GetSignupPaymentArray(QQ::OrderBy(QQN::SignupPayment()->TransactionDate)));
// Add "Balance Due"
$arrDataSource[] = null;
$this->dtgProducts->DataSource = $arrDataSource;
}
示例3: dtgFormProducts_Bind
protected function dtgFormProducts_Bind()
{
$this->dtgFormProducts->DataSource = $this->objSignupForm->GetFormProductArray(QQ::OrderBy(QQN::FormProduct()->FormProductTypeId, QQN::FormProduct()->OrderNumber));
}
示例4: ResolveContentItem
/**
* Used internally by the Meta-based Add Column tools.
*
* Given a QQNode or a Text String, this will return a FormProduct-based QQNode.
* It will also verify that it is a proper FormProduct-based QQNode, and will throw an exception otherwise.
*
* @param mixed $mixContent
* @return QQNode
*/
protected function ResolveContentItem($mixContent)
{
if ($mixContent instanceof QQNode) {
if (!$mixContent->_ParentNode) {
throw new QCallerException('Content QQNode cannot be a Top Level Node');
}
if ($mixContent->_RootTableName == 'form_product') {
if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
$objCurrentNode = $mixContent;
while ($objCurrentNode = $objCurrentNode->_ParentNode) {
if (!$objCurrentNode instanceof QQNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
}
return $mixContent;
} else {
throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "form_product".');
}
} else {
if (is_string($mixContent)) {
switch ($mixContent) {
case 'Id':
return QQN::FormProduct()->Id;
case 'SignupFormId':
return QQN::FormProduct()->SignupFormId;
case 'SignupForm':
return QQN::FormProduct()->SignupForm;
case 'OrderNumber':
return QQN::FormProduct()->OrderNumber;
case 'FormProductTypeId':
return QQN::FormProduct()->FormProductTypeId;
case 'FormPaymentTypeId':
return QQN::FormProduct()->FormPaymentTypeId;
case 'Name':
return QQN::FormProduct()->Name;
case 'Description':
return QQN::FormProduct()->Description;
case 'DateStart':
return QQN::FormProduct()->DateStart;
case 'DateEnd':
return QQN::FormProduct()->DateEnd;
case 'MinimumQuantity':
return QQN::FormProduct()->MinimumQuantity;
case 'MaximumQuantity':
return QQN::FormProduct()->MaximumQuantity;
case 'Cost':
return QQN::FormProduct()->Cost;
case 'Deposit':
return QQN::FormProduct()->Deposit;
case 'ViewFlag':
return QQN::FormProduct()->ViewFlag;
default:
throw new QCallerException('Simple Property not found in FormProductDataGrid content: ' . $mixContent);
}
} else {
if ($mixContent instanceof QQAssociationNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
} else {
throw new QCallerException('Invalid Content type');
}
}
}
}
示例5: foreach
break;
case FormQuestionType::Number:
case FormQuestionType::Age:
print $objAnswer->IntegerValue;
break;
case FormQuestionType::DateofBirth:
if ($objAnswer->DateValue) {
print $objAnswer->DateValue->ToString('M/D/YYYY');
}
break;
}
}
print ",";
}
if ($objSignupForm->CountFormProducts() > 0) {
foreach ($objSignupForm->GetFormProductArray(QQ::OrderBy(QQN::FormProduct()->FormProductTypeId, QQN::FormProduct()->OrderNumber)) as $objFormProduct) {
if ($objFormProduct->ViewFlag) {
$objSignupProduct = SignupProduct::LoadBySignupEntryIdFormProductId($objSignupEntry->Id, $objFormProduct->Id);
if ($objSignupProduct) {
print QApplication::DisplayCurrency($objSignupProduct->Amount);
} else {
print " ";
}
print ",";
}
}
print QApplication::DisplayCurrency($objSignupEntry->AmountTotal);
print ",";
print QApplication::DisplayCurrency($objSignupEntry->AmountPaid);
print ",";
print QApplication::DisplayCurrency($objSignupEntry->AmountBalance);
示例6: dtgSignupEntries_SetupColumns
public function dtgSignupEntries_SetupColumns()
{
$this->dtgSignupEntries->RemoveAllColumns();
$this->dtgSignupEntries->MetaAddColumn(QQN::SignupEntry()->Person->LastName, 'Name=Name', 'Html=<?= $_FORM->RenderName($_ITEM); ?>', 'HtmlEntities=false');
// $this->dtgSignupEntries->MetaAddTypeColumn('SignupEntryStatusTypeId', 'SignupEntryStatusType', 'Name=Status');
foreach ($this->objSignupForm->GetFormQuestionArray(QQ::OrderBy(QQN::FormQuestion()->OrderNumber)) as $objFormQuestion) {
if ($objFormQuestion->ViewFlag) {
$this->dtgSignupEntries->AddColumn(new QDataGridColumn($objFormQuestion->ShortDescription, '<?= $_FORM->RenderAnswer($_ITEM, ' . $objFormQuestion->Id . ',' . $objFormQuestion->FormQuestionTypeId . '); ?>', 'HtmlEntities=false'));
}
}
foreach ($this->objSignupForm->GetFormProductArray(QQ::OrderBy(QQN::FormProduct()->FormProductTypeId, QQN::FormProduct()->OrderNumber)) as $objFormProduct) {
if ($objFormProduct->ViewFlag) {
/* $this->dtgSignupEntries->AddColumn(new QDataGridColumn($objFormProduct->Name. ' Quantity', '<?= $_FORM->RenderProductQuantity($_ITEM, ' . $objFormProduct->Id . '); ?>', 'HtmlEntities=false'));*/
$this->dtgSignupEntries->AddColumn(new QDataGridColumn($objFormProduct->Name, '<?= $_FORM->RenderProductAmount($_ITEM, ' . $objFormProduct->Id . '); ?>', 'HtmlEntities=false'));
}
}
if ($this->objSignupForm->CountFormProducts()) {
$this->dtgSignupEntries->MetaAddColumn(QQN::SignupEntry()->AmountPaid, 'Name=Paid', 'Html=<?= $_FORM->RenderAmount($_ITEM->AmountPaid); ?>');
$this->dtgSignupEntries->MetaAddColumn(QQN::SignupEntry()->AmountBalance, 'Name=Balance', 'Html=<?= $_FORM->RenderAmount($_ITEM->AmountBalance); ?>');
$this->dtgSignupEntries->AddColumn(new QDataGridColumn('Payment Type', '<?= $_FORM->RenderPaymentType($_ITEM); ?>', 'HtmlEntities=false'));
}
$this->dtgSignupEntries->MetaAddColumn(QQN::SignupEntry()->DateSubmitted, 'Name=Submitted', 'Html=<?= $_ITEM->DateSubmitted ? $_ITEM->DateSubmitted->ToString("MMM D YYYY") : null; ?>');
}
示例7: dtgProducts_Bind
public function dtgProducts_Bind(QDataGrid $dtgProducts)
{
$intFormProductTypeId = $dtgProducts->Name;
$dtgProducts->DataSource = FormProduct::LoadArrayBySignupFormIdFormProductTypeId($this->objSignupForm->Id, $intFormProductTypeId, QQ::OrderBy(QQN::FormProduct()->OrderNumber));
}
示例8: CountFormProductsByType
/**
* @param integer $intFormProductTypeId
* @param QClause[] $objClauses
* @return integer
*/
public function CountFormProductsByType($intFormProductTypeId, $objClauses = array())
{
return FormProduct::QueryCount(QQ::AndCondition(QQ::Equal(QQN::FormProduct()->SignupFormId, $this->Id), QQ::Equal(QQN::FormProduct()->FormProductTypeId, $intFormProductTypeId)), $objClauses);
}
示例9: CountByFormPaymentTypeId
/**
* Count FormProducts
* by FormPaymentTypeId Index(es)
* @param integer $intFormPaymentTypeId
* @return int
*/
public static function CountByFormPaymentTypeId($intFormPaymentTypeId, $objOptionalClauses = null)
{
// Call FormProduct::QueryCount to perform the CountByFormPaymentTypeId query
return FormProduct::QueryCount(QQ::Equal(QQN::FormProduct()->FormPaymentTypeId, $intFormPaymentTypeId), $objOptionalClauses);
}