本文整理汇总了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);
}
}
示例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';