本文整理汇总了PHP中Mage_Core_Model_Abstract::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::getEmail方法的具体用法?PHP Mage_Core_Model_Abstract::getEmail怎么用?PHP Mage_Core_Model_Abstract::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::getEmail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newCustomerActivationState
/**
* @test
* @dataProvider dataProvider
*/
public function newCustomerActivationState($email, $storeCode, $groupCode, $activeByDefault, $specificGroups)
{
$store = $this->app()->getStore($storeCode);
$store->setConfig(Netzarbeiter_CustomerActivation_Helper_Data::XML_PATH_DEFAULT_STATUS, $activeByDefault);
$store->setConfig(Netzarbeiter_CustomerActivation_Helper_Data::XML_PATH_DEFAULT_STATUS_BY_GROUP, $specificGroups);
$this->setCurrentStore($store);
/* @var $group Mage_Customer_Model_Group */
$group = Mage::getModel('customer/group')->load($groupCode, 'customer_group_code');
$this->_model = Mage::getModel('customer/customer');
$this->_model->setData(array('store_id' => $store->getId(), 'website_id' => $store->getWebsiteId(), 'group_id' => $group->getId(), 'email' => $email))->save();
// Since it's so easy thanks to EcomDev_PHPUnit, lets check triggered events, too
$this->assertEventDispatchedExactly('customer_save_before', 1);
$this->assertEventDispatchedExactly('customer_save_after', 1);
$expected = $this->expected("%s-%d-%d-%d", $storeCode, $group->getId(), $activeByDefault, $specificGroups)->getIsActivated();
$message = sprintf("Expected new customer %s with group %s in store %s to be %s, but found to be %s\n" . "All groups default status: %s, %srequire activation for specific groups)", $this->_model->getEmail(), $group->getCode(), $store->getCode(), $expected ? 'activated' : 'inactive', $expected ? 'inactive' : 'active', $activeByDefault ? 'active' : 'inactive', $specificGroups ? '' : "don't ");
$this->assertEquals($expected, $this->_model->getCustomerActivated(), $message);
}
示例2: _afterSave
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
$queueCollection = Mage::getModel('email/queue')->getCollection()->addFieldToFilter('recipient_email', $object->getEmail())->addFieldToFilter('status', Mirasvit_Email_Model_Queue::STATUS_PENDING);
if ($object->getTriggerId() > 0) {
$queueCollection->addFieldToFilter('trigger_id', $object->getTriggerId());
}
foreach ($queueCollection as $item) {
$item->unsubscribe();
}
return parent::_afterSave($object);
}
示例3: userExists
/**
* Check if user exists
*
* @param Mage_Core_Model_Abstract $user
* @return array|false
*/
public function userExists(Mage_Core_Model_Abstract $user)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select();
$binds = array('username' => $user->getUsername(), 'email' => $user->getEmail(), 'user_id' => (int) $user->getId());
$select->from($this->getMainTable())->where('(username = :username OR email = :email)')->where('user_id <> :user_id');
return $adapter->fetchRow($select, $binds);
}
示例4: userExists
public function userExists(Mage_Core_Model_Abstract $user)
{
$usersTable = $this->getTable('api/user');
$select = $this->_getReadAdapter()->select();
$select->from($usersTable);
$select->where("({$usersTable}.username = '{$user->getUsername()}' OR {$usersTable}.email = '{$user->getEmail()}') AND {$usersTable}.user_id != '{$user->getId()}'");
return $this->_getReadAdapter()->fetchRow($select);
}
示例5: userExists
/**
* Check if user not unique
*
* @param Mage_Core_Model_Abstract $user
* @return array
*/
public function userExists(Mage_Core_Model_Abstract $user)
{
$usersTable = $this->getTable('api/user');
$adapter = $this->_getReadAdapter();
$condition = array($adapter->quoteInto("{$usersTable}.username = ?", $user->getUsername()), $adapter->quoteInto("{$usersTable}.email = ?", $user->getEmail()));
$select = $adapter->select()->from($usersTable)->where(implode(' OR ', $condition))->where($usersTable . '.user_id != ?', (int) $user->getId());
return $adapter->fetchRow($select);
}
示例6: _afterSave
/**
* Perform actions after object save
*
* @param Varien_Object $object
* @return Mage_Review_Model_Resource_Review
*/
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
$adapter = $this->_getWriteAdapter();
/**
* save detail
*/
$detail = array('title' => $object->getTitle(), 'detail' => $object->getDetail(), 'nickname' => $object->getNickname(), 'location' => $object->getLocation(), 'email' => $object->getEmail());
$select = $adapter->select()->from($this->_reviewDetailTable, 'detail_id')->where('review_id = :review_id');
$detailId = $adapter->fetchOne($select, array(':review_id' => $object->getId()));
if ($detailId) {
$condition = array("detail_id = ?" => $detailId);
$adapter->update($this->_reviewDetailTable, $detail, $condition);
} else {
$detail['store_id'] = $object->getStoreId();
$detail['customer_id'] = $object->getCustomerId();
$detail['review_id'] = $object->getId();
$adapter->insert($this->_reviewDetailTable, $detail);
}
/**
* save stores
*/
$stores = $object->getStores();
if (!empty($stores)) {
$condition = array('review_id = ?' => $object->getId());
$adapter->delete($this->_reviewStoreTable, $condition);
$insertedStoreIds = array();
foreach ($stores as $storeId) {
if (in_array($storeId, $insertedStoreIds)) {
continue;
}
$insertedStoreIds[] = $storeId;
$storeInsert = array('store_id' => $storeId, 'review_id' => $object->getId());
$adapter->insert($this->_reviewStoreTable, $storeInsert);
}
}
// reaggregate ratings, that depend on this review
$this->_aggregateRatings($this->_loadVotedRatingIds($object->getId()), $object->getEntityPkValue());
return $this;
}