當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Attribute::Save方法代碼示例

本文整理匯總了PHP中Attribute::Save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Attribute::Save方法的具體用法?PHP Attribute::Save怎麽用?PHP Attribute::Save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Attribute的用法示例。


在下文中一共展示了Attribute::Save方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Form_Create

 protected function Form_Create()
 {
     $this->lblHomeAddress = new QLabel($this);
     $this->lblHomeAddress->HtmlEntities = false;
     $this->lblMailingAddress = new QLabel($this);
     $this->lblMailingAddress->Name = 'Mailing Address';
     $this->lblMailingAddress->HtmlEntities = false;
     $this->lblEmailAddress = new QLabel($this);
     $this->lblEmailAddress->Name = 'Email Address';
     $this->lblBulkEmail = new QLabel($this);
     $this->lblBulkEmail->Name = 'ALCF Email Announcements';
     $this->lblMobilePhone = new QLabel($this);
     $this->lblMobilePhone->Name = 'Mobile Phone';
     $this->lblDateOfBirth = new QLabel($this);
     $this->lblDateOfBirth->Name = 'Date of Birth';
     $this->lblGender = new QLabel($this);
     $this->lblGender->Name = 'Gender';
     $this->lblUsername = new QLabel($this);
     $this->lblUsername->Name = 'my.alcf Login Username';
     $this->lblQuestion = new QLabel($this);
     $this->lblQuestion->Name = 'Security Question';
     $this->lblAnswer = new QLabel($this);
     $this->lblAnswer->Name = 'Your Answer';
     $this->lblAnswer->Text = '••••••••';
     $this->lblAnswer->HtmlEntities = false;
     $this->lblPassword = new QLabel($this);
     $this->lblPassword->Name = 'Password';
     $this->lblPassword->Text = '••••••••';
     $this->lblPassword->HtmlEntities = false;
     $this->btnAddress = new QButton($this);
     $this->btnAddress->CssClass = 'primary';
     $this->btnAddress->Text = 'Edit Address Information';
     $this->btnAddress->AddAction(new QClickEvent(), new QAjaxAction('btnAddress_Click'));
     $this->btnContact = new QButton($this);
     $this->btnContact->CssClass = 'primary';
     $this->btnContact->Text = 'Edit Contact Information';
     $this->btnContact->AddAction(new QClickEvent(), new QAjaxAction('btnContact_Click'));
     $this->btnPersonal = new QButton($this);
     $this->btnPersonal->CssClass = 'primary';
     $this->btnPersonal->Text = 'Edit Personal Information';
     $this->btnPersonal->AddAction(new QClickEvent(), new QAjaxAction('btnPersonal_Click'));
     $this->btnSecurity = new QButton($this);
     $this->btnSecurity->CssClass = 'primary';
     $this->btnSecurity->Text = 'Edit Login Information';
     $this->btnSecurity->AddAction(new QClickEvent(), new QAjaxAction('btnSecurity_Click'));
     $this->dlgEdit_Setup('Address');
     $this->dlgEdit_Setup('Contact');
     $this->dlgEdit_Setup('Personal');
     $this->dlgEdit_Setup('Security');
     $this->mctPerson = new PersonMetaControl($this->dlgPersonal, QApplication::$PublicLogin->Person);
     $this->dtxDateOfBirth = $this->mctPerson->dtxDateOfBirth_Create();
     $this->calDateOfBirth = $this->mctPerson->calDateOfBirth_Create();
     $this->lstGender = $this->mctPerson->lstGender_Create();
     $this->lstGender->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->dtxDateOfBirth->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     if ($this->mctPerson->Person->DobGuessedFlag || $this->mctPerson->Person->DobYearApproximateFlag) {
         $this->dtxDateOfBirth->Text = null;
     }
     $this->Refresh();
     // Set Post 2016 Attribute by default if someone logs in that isn't set
     $isPost2016 = false;
     $attributeArray = $this->mctPerson->Person->GetAttributeValueArray();
     foreach ($attributeArray as $objAttribute) {
         if ($objAttribute->Attribute->Name == 'Post-2016') {
             $isPost2016 = true;
             break;
         }
     }
     if (!$isPost2016) {
         $objAttribute = new Attribute();
         $objAttribute->Name = 'Post-2016';
         $objAttribute->AttributeDataTypeId = AttributeDataType::Checkbox;
         $objAttribute->Save();
         $this->mctPerson->Person->SetAttribute($objAttribute, true);
     }
 }
開發者ID:alcf,項目名稱:chms,代碼行數:76,代碼來源:index.php

示例2: Category

     }
     break;
 case 'savecat':
     USES_paypal_class_category();
     $C = new Category($_POST['cat_id']);
     if (!$C->Save($_POST)) {
         $content .= PAYPAL_popupMsg($LANG_PP['invalid_form']);
         $view = 'editcat';
     } else {
         $view = 'catlist';
     }
     break;
 case 'saveopt':
     USES_paypal_class_attribute();
     $Attr = new Attribute($_POST['attr_id']);
     if (!$Attr->Save($_POST)) {
         $content .= PAYPAL_popupMsg($LANG_PP['invalid_form']);
     }
     if (isset($_POST['attr_id']) && !empty($_POST['attr_id'])) {
         // Updating an existing option, return to the list
         $view = 'attributes';
     } else {
         $view = 'editattr';
     }
     break;
 case 'deleteopt':
     USES_paypal_class_attribute();
     // attr_id could be via $_GET or $_POST
     $Attr = new Attribute($_REQUEST['attr_id']);
     $Attr->Delete();
     $view = 'attributes';
開發者ID:NewRoute,項目名稱:paypal,代碼行數:31,代碼來源:index.php


注:本文中的Attribute::Save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。