本文整理汇总了PHP中AdminController::afterUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::afterUpdate方法的具体用法?PHP AdminController::afterUpdate怎么用?PHP AdminController::afterUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::afterUpdate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterUpdate
protected function afterUpdate($new_shop)
{
$categories = Tools::getValue('categoryBox');
array_unshift($categories, Configuration::get('PS_ROOT_CATEGORY'));
if (!Category::updateFromShop($categories, $new_shop->id)) {
$this->errors[] = $this->l('You need to select at least the root category.');
}
if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
$new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
}
return parent::afterUpdate($new_shop);
}
示例2: afterUpdate
/**
* @param Employee $object
*
* @return bool
*/
protected function afterUpdate($object)
{
$res = parent::afterUpdate($object);
// Update cookie if needed
if (Tools::getValue('id_employee') == $this->context->employee->id && ($passwd = Tools::getValue('passwd')) && $object->passwd != $this->context->employee->passwd) {
$this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
if (Tools::getValue('passwd_send_email')) {
$params = array('{email}' => $object->email, '{lastname}' => $object->lastname, '{firstname}' => $object->firstname, '{passwd}' => $passwd);
Mail::Send($object->id_lang, 'password', Mail::l('Your new password', $object->id_lang), $params, $object->email, $object->firstname . ' ' . $object->lastname);
}
}
return $res;
}
示例3: afterUpdate
protected function afterUpdate($object)
{
$res = parent::afterUpdate($object);
// Update cookie if needed
if (Tools::getValue('id_employee') == $this->context->employee->id && Tools::getValue('passwd') && $object->passwd != $this->context->employee->passwd) {
$this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
}
return $res;
}
示例4: afterUpdate
/**
* @param Shop $new_shop
* @return bool
*/
protected function afterUpdate($new_shop)
{
$categories = Tools::getValue('categoryBox');
if (!is_array($categories)) {
$this->errors[] = $this->l('Please create some sub-categories for this root category.');
return false;
}
array_unshift($categories, Configuration::get('PS_ROOT_CATEGORY'));
if (!Category::updateFromShop($categories, $new_shop->id)) {
$this->errors[] = $this->l('You need to select at least the root category.');
}
if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
$new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
}
if (Tools::isSubmit('submitAddshopAndStay') || Tools::isSubmit('submitAddshop')) {
$this->redirect_after = self::$currentIndex . '&shop_id=' . (int) $new_shop->id . '&conf=4&token=' . $this->token;
}
return parent::afterUpdate($new_shop);
}
示例5: afterUpdate
protected function afterUpdate($new_shop)
{
if (!Category::updateFromShop(Tools::getValue('categoryBox'), $new_shop->id)) {
$this->errors[] = $this->l('You need to select at least the root category.');
}
if (Tools::getValue('useImportData') && ($import_data = Tools::getValue('importData')) && is_array($import_data)) {
$new_shop->copyShopData((int) Tools::getValue('importFromShop'), $import_data);
}
return parent::afterUpdate($new_shop);
}