本文整理汇总了PHP中MemberModel::getTable方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberModel::getTable方法的具体用法?PHP MemberModel::getTable怎么用?PHP MemberModel::getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberModel
的用法示例。
在下文中一共展示了MemberModel::getTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateDefaultAddress
/**
* Mark existing addresses as not default if the new address is default
*
* @param Address $objAddress
*/
protected function updateDefaultAddress(Address $objAddress)
{
$arrSet = array();
if ($objAddress->isDefaultBilling) {
$arrSet['isDefaultBilling'] = '';
}
if ($objAddress->isDefaultShipping) {
$arrSet['isDefaultShipping'] = '';
}
if (!empty($arrSet)) {
// @todo restore foratting when #6623 is fixed in Contao core
\Database::getInstance()->prepare("UPDATE " . $objAddress->getTable() . " %s WHERE pid=? AND ptable=? AND store_id=? AND id!=?")->set($arrSet)->execute($this->member, \MemberModel::getTable(), $this->store_id, $objAddress->id);
}
}
示例2: edit
/**
* Edit an address record. Based on the PersonalData core module
* @param integer
* @return void
*/
protected function edit($intAddressId = 0)
{
$table = Address::getTable();
\System::loadLanguageFile(\MemberModel::getTable());
$this->Template = new \Isotope\Template($this->memberTpl);
$this->Template->hasError = false;
$this->Template->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['saveData']);
if ($intAddressId === 0) {
$objAddress = Address::createForMember(\FrontendUser::getInstance()->id);
} else {
$objAddress = Address::findOneForMember($intAddressId, \FrontendUser::getInstance()->id);
}
if (null === $objAddress) {
global $objPage;
\Controller::redirect(\Controller::generateFrontendUrl($objPage->row()));
}
$objForm = new Form($table . '_' . $this->id, 'POST', function ($objForm) {
return \Input::post('FORM_SUBMIT') === $objForm->getFormId();
}, (bool) $this->tableless);
$objForm->bindModel($objAddress);
// Add form fields and modify for the address book
$arrFields = $this->arrFields;
$objForm->addFieldsFromDca($table, function ($strName, &$arrDca) use($arrFields) {
if (!in_array($strName, $arrFields) || !$arrDca['eval']['feEditable']) {
return false;
}
// Map checkboxWizard to regular checkbox widget
if ($arrDca['inputType'] == 'checkboxWizard') {
$arrDca['inputType'] = 'checkbox';
}
// Special field "country"
if ($strName == 'country') {
$arrCountries = array_merge(Isotope::getConfig()->getBillingCountries(), Isotope::getConfig()->getShippingCountries());
$arrDca['reference'] = $arrDca['options'];
$arrDca['options'] = array_values(array_intersect(array_keys($arrDca['options']), $arrCountries));
$arrDca['default'] = Isotope::getConfig()->billing_country;
}
return true;
});
if ($objForm->isSubmitted()) {
if ($objForm->validate()) {
$objAddress->save();
// Call onsubmit_callback
if (is_array($GLOBALS['TL_DCA'][$table]['config']['onsubmit_callback'])) {
foreach ($GLOBALS['TL_DCA'][$table]['config']['onsubmit_callback'] as $callback) {
$objCallback = \System::importStatic($callback[0]);
$objCallback->{$callback}[1]($objAddress);
}
}
global $objPage;
\Controller::redirect(\Controller::generateFrontendUrl($objPage->row()));
} else {
$this->Template->hasError = true;
}
}
$objForm->addToTemplate($this->Template);
// Add groups
$arrGroups = array();
foreach ($objForm->getFormFields() as $strName => $arrConfig) {
if ($arrConfig['feGroup'] != '') {
$arrGroups[$arrConfig['feGroup']][$strName] = $objForm->getWidget($strName)->parse();
}
}
foreach ($arrGroups as $k => $v) {
$this->Template->{$k} = $v;
}
$this->Template->addressDetails = $GLOBALS['TL_LANG'][$table]['addressDetails'];
$this->Template->contactDetails = $GLOBALS['TL_LANG'][$table]['contactDetails'];
$this->Template->personalData = $GLOBALS['TL_LANG'][$table]['personalData'];
$this->Template->loginDetails = $GLOBALS['TL_LANG'][$table]['loginDetails'];
}
示例3: array
<?php
/**
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009-2014 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @package Isotope
* @link http://isotopeecommerce.org
* @license http://opensource.org/licenses/lgpl-3.0.html
*/
/**
* Table tl_iso_rule_usage
*/
$GLOBALS['TL_DCA']['tl_iso_rule_usage'] = array('config' => array('sql' => array('keys' => array('id' => 'primary', 'pid' => 'index'))), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => \Isotope\Model\Rule::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'order_id' => array('foreignKey' => \Isotope\Model\ProductCollection::getTable() . '.document_number', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'config_id' => array('foreignKey' => \Isotope\Model\Config::getTable() . '.name', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'member_id' => array('foreignKey' => \MemberModel::getTable() . '.username', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy'))));