本文整理汇总了PHP中MemberModel::findByEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberModel::findByEmail方法的具体用法?PHP MemberModel::findByEmail怎么用?PHP MemberModel::findByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberModel
的用法示例。
在下文中一共展示了MemberModel::findByEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMemberProperties
public static function addMemberProperties($arrDetails)
{
$arrRecipientFields = array();
\Controller::loadDataContainer('orm_avisota_recipient');
foreach ($GLOBALS['TL_DCA']['orm_avisota_recipient']['metapalettes']['default'] as $strPalette => $arrFields) {
$arrRecipientFields = array_merge($arrRecipientFields, $arrFields);
}
$objMember = \MemberModel::findByEmail($arrDetails['email']);
foreach ($arrRecipientFields as $strName) {
// ignore member data if a csv column is already there
if ($arrDetails[$strName]) {
continue;
}
// ignore salutations inserted in the backend
if ($strName == 'salutation') {
continue;
}
if ($strName != 'email') {
$arrDetails[$strName] = '';
}
// enhance with member data if existing
if ($objMember !== null) {
if ($objMember->{$strName}) {
$arrDetails[$strName] = $objMember->{$strName};
} else {
// try synonyms
$synonymizer = $GLOBALS['container']['avisota.recipient.synonymizer'];
$arrSynonyms = $synonymizer->findSynonyms($strName);
if ($arrSynonyms) {
foreach ($arrSynonyms as $strSynonym) {
if ($objMember->{$strSynonym}) {
$arrDetails[$strName] = $objMember->{$strSynonym};
}
}
}
}
}
}
return $arrDetails;
}
示例2: addMemberProperties
public static function addMemberProperties($arrProperties)
{
$arrResult = array();
foreach ($arrProperties as $strName => $strValue) {
// ignore salutations inserted in the backend
if ($strName == 'salutation') {
continue;
}
$objMember = \MemberModel::findByEmail($arrProperties['email']);
if (!$strValue) {
// first store the existing name-value pair
$arrResult[$strName] = $strValue;
// enhance member data if existing
if ($objMember !== null) {
if ($objMember->{$strName}) {
$arrResult[$strName] = $objMember->{$strName};
} else {
// try synonyms
$synonymizer = $GLOBALS['container']['avisota.recipient.synonymizer'];
$arrSynonyms = $synonymizer->findSynonyms($strName);
if ($arrSynonyms) {
foreach ($arrSynonyms as $strSynonym) {
if ($objMember->{$strSynonym}) {
$arrResult[$strName] = $objMember->{$strSynonym};
}
}
}
}
}
} else {
$arrResult[$strName] = $strValue;
}
}
return $arrResult;
}
开发者ID:heimrichhannot,项目名称:contao-avisota_subscription_recipient_plus,代码行数:35,代码来源:RecipientsRecipientSourceSalutations.php