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


PHP Attribute::QuerySingle方法代码示例

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


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

 /**
  * Load a single Attribute object,
  * by Id Index(es)
  * @param integer $intId
  * @return Attribute
  */
 public static function LoadById($intId, $objOptionalClauses = null)
 {
     return Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Id, $intId), $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:10,代码来源:AttributeGen.class.php


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