当前位置: 首页>>代码示例>>PHP>>正文


PHP QQN::Attribute方法代码示例

本文整理汇总了PHP中QQN::Attribute方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::Attribute方法的具体用法?PHP QQN::Attribute怎么用?PHP QQN::Attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QQN的用法示例。


在下文中一共展示了QQN::Attribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Form_Create

 protected function Form_Create()
 {
     $this->strInitialToken = QApplication::PathInfo(0);
     if ($this->strInitialToken) {
         $this->objList = CommunicationList::LoadByToken($this->strInitialToken);
     }
     $this->chkBtnListArray = array();
     foreach (CommunicationList::LoadArrayBySubscribable(true, QQ::OrderBy(QQN::CommunicationList()->Token)) as $objEmailList) {
         $objItemList = new QCheckBox($this);
         $objItemList->Name = $objEmailList->Token;
         $objItemList->Text = $objEmailList->Name;
         if ($objEmailList->Token == $this->strInitialToken) {
             $objItemList->Checked = true;
         }
         $this->chkBtnListArray[] = $objItemList;
     }
     $this->txtEmail = new QTextBox($this);
     $this->txtEmail->Name = 'Email: ';
     $this->txtEmail->Visible = true;
     $this->lstTerminationReason = new QListBox($this);
     $this->lstTerminationReason->Name = 'Reason for unsubscribing: ';
     $this->objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, 'Unsubscribe From Church Newsletter'));
     foreach ($this->objAttribute->GetAttributeOptionArray(QQ::OrderBy(QQN::AttributeOption()->Name)) as $objOption) {
         $this->lstTerminationReason->AddItem($objOption->Name, $objOption->Id);
     }
     $this->lstTerminationReason->AddItem('- Other... -', -1);
     $this->lstTerminationReason->AddAction(new QChangeEvent(), new QAjaxAction('lstTerminationReason_Change'));
     $this->txtOther = new QTextBox($this);
     $this->txtOther->Name = 'Other';
     $this->txtOther->Visible = false;
     $this->btnUnsubscribe = new QButton($this);
     $this->btnUnsubscribe->Name = 'Unsubscribe';
     $this->btnUnsubscribe->Text = 'Unsubscribe';
     $this->btnUnsubscribe->CssClass = 'primary';
     $this->btnUnsubscribe->AddAction(new QClickEvent(), new QAjaxAction('btnUnsubscribe_Click'));
     $this->lblMessage = new QLabel($this);
     $this->lblMessage->FontBold = true;
     $this->lblMessage->ForeColor = 'red';
     $this->lblMessage->Visible = false;
 }
开发者ID:alcf,项目名称:chms,代码行数:40,代码来源:index.php

示例2: SaveAttribute

 protected function SaveAttribute()
 {
     if ($this->txtAttributePreviousChurch != null && $this->txtAttributeOccupation->Text != "") {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Previous Church"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->TextValue = $this->txtAttributePreviousChurch->Text;
         $objAttributeValue->DatetimeValue = QDateTime::Now();
         $objAttributeValue->Save();
     }
     if ($this->txtAttributeOccupation != null && $this->txtAttributeOccupation->Text != "") {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Occupation"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->TextValue = $this->txtAttributeOccupation->Text;
         $objAttributeValue->DatetimeValue = QDateTime::Now();
         $objAttributeValue->Save();
     }
     if ($this->lstAttributeMethodJoin != null && $this->lstAttributeMethodJoin->SelectedName != '- Select One -') {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Method of Joining ALCF"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->TextValue = $this->lstAttributeMethodJoin->SelectedName;
         $objAttributeValue->DatetimeValue = QDateTime::Now();
         $objAttributeValue->SingleAttributeOptionId = $this->lstAttributeMethodJoin->SelectedValue;
         $objAttributeValue->SingleAttributeOption->Name = $this->lstAttributeMethodJoin->SelectedName;
         $objAttributeValue->Save();
     }
     if ($this->lstAttributeEthnicity != null && $this->lstAttributeEthnicity->SelectedName != '- Select One -') {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Ethnicity"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->TextValue = $this->lstAttributeEthnicity->SelectedName;
         $objAttributeValue->DatetimeValue = QDateTime::Now();
         $objAttributeValue->SingleAttributeOptionId = $this->lstAttributeEthnicity->SelectedValue;
         $objAttributeValue->SingleAttributeOption->Name = $this->lstAttributeEthnicity->SelectedName;
         $objAttributeValue->Save();
     }
     if ($this->dtxAttributeDateAcceptedChrist != null && $this->dtxAttributeDateAcceptedChrist->DateTime != null) {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Date Accepted Christ"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->DatetimeValue = $this->dtxAttributeDateAcceptedChrist->DateTime;
         $objAttributeValue->DateValue = $this->dtxAttributeDateAcceptedChrist->DateTime;
         $objAttributeValue->Save();
     }
     if ($this->chkAcceptedChristAtALCF->Checked) {
         $objAttributeValue = new AttributeValue();
         $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Accepted Christ At ALCF"));
         $objAttributeValue->AttributeId = $objAttribute->Id;
         $objAttributeValue->PersonId = $this->mctPerson->Person->Id;
         $objAttributeValue->BooleanValue = true;
         $objAttributeValue->Save();
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:60,代码来源:new.php

示例3: ResolveContentItem

 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a Attribute-based QQNode.
  * It will also verify that it is a proper Attribute-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 == 'attribute') {
             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 "attribute".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::Attribute()->Id;
                 case 'AttributeDataTypeId':
                     return QQN::Attribute()->AttributeDataTypeId;
                 case 'Name':
                     return QQN::Attribute()->Name;
                 default:
                     throw new QCallerException('Simple Property not found in AttributeDataGrid 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');
             }
         }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:53,代码来源:AttributeDataGridGen.class.php

示例4: dtgAttributes_Bind

 public function dtgAttributes_Bind()
 {
     $objExisting = array();
     foreach ($this->objPerson->GetAttributeValueArray() as $objAttributeValue) {
         $objExisting[$objAttributeValue->AttributeId] = true;
     }
     $objAttributeArray = array();
     foreach (Attribute::LoadAll(QQ::OrderBy(QQN::Attribute()->Name)) as $objAttribute) {
         if (!array_key_exists($objAttribute->Id, $objExisting)) {
             $objAttributeArray[] = $objAttribute;
         }
     }
     $this->iAttributeCount = count($objAttributeArray);
     $this->dtgAttributes->DataSource = $objAttributeArray;
 }
开发者ID:alcf,项目名称:chms,代码行数:15,代码来源:Vicp_Attributes_Add.class.php

示例5: CountByAttributeDataTypeId

 /**
  * Count Attributes
  * by AttributeDataTypeId Index(es)
  * @param integer $intAttributeDataTypeId
  * @return int
  */
 public static function CountByAttributeDataTypeId($intAttributeDataTypeId, $objOptionalClauses = null)
 {
     // Call Attribute::QueryCount to perform the CountByAttributeDataTypeId query
     return Attribute::QueryCount(QQ::Equal(QQN::Attribute()->AttributeDataTypeId, $intAttributeDataTypeId), $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:11,代码来源:AttributeGen.class.php


注:本文中的QQN::Attribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。