当前位置: 首页>>代码示例>>PHP>>正文


PHP Hook::Exec方法代码示例

本文整理汇总了PHP中Hook::Exec方法的典型用法代码示例。如果您正苦于以下问题:PHP Hook::Exec方法的具体用法?PHP Hook::Exec怎么用?PHP Hook::Exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hook的用法示例。


在下文中一共展示了Hook::Exec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadCustomer

 /**
  * loadCustomer() method load customer in PS
  *
  * @param numeric $nSocialId
  */
 protected function loadCustomer($nSocialId)
 {
     // get customer ID
     $iCustomerId = self::getCustomerId($nSocialId);
     // auth customer
     $oCustomer = new Customer($iCustomerId);
     // is valid customer
     if (Validate::isLoadedObject($oCustomer)) {
         if (version_compare(_PS_VERSION_, '1.5', '>')) {
             Context::getContext()->cookie->id_customer = intval($oCustomer->id);
             Context::getContext()->cookie->customer_lastname = $oCustomer->lastname;
             Context::getContext()->cookie->customer_firstname = $oCustomer->firstname;
             Context::getContext()->cookie->logged = 1;
             Context::getContext()->cookie->passwd = $oCustomer->passwd;
             Context::getContext()->cookie->email = $oCustomer->email;
             //                Context::getContext()->cookie->is_guest = !Tools::getValue('is_new_customer', 1);
             Context::getContext()->customer->logged = 1;
             if (Configuration::get('PS_CART_FOLLOWING') && (empty(Context::getContext()->cookie->id_cart) || Cart::getNbProducts(Context::getContext()->cookie->id_cart) == 0)) {
                 Context::getContext()->cookie->id_cart = intval(Cart::lastNoneOrderedCart($oCustomer->id));
             }
             Hook::Exec('authentication');
         } else {
             global $cookie;
             $cookie->id_customer = intval($oCustomer->id);
             $cookie->customer_lastname = $oCustomer->lastname;
             $cookie->customer_firstname = $oCustomer->firstname;
             $cookie->logged = 1;
             $cookie->passwd = $oCustomer->passwd;
             $cookie->email = $oCustomer->email;
             //                $cookie->is_guest = !Tools::getValue('is_new_customer', 1);
             $oCustomer->logged = 1;
             if (Configuration::get('PS_CART_FOLLOWING') && (empty($cookie->id_cart) || Cart::getNbProducts($cookie->id_cart) == 0)) {
                 $cookie->id_cart = intval(Cart::lastNoneOrderedCart($oCustomer->id));
             }
             Module::HookExec('authentication');
         }
     } else {
         throw new BT_ConnectorException(FacebookPsConnect::$oModule->l('Internal server error => authentication failed', 'base-connector_class'), 531);
     }
 }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:45,代码来源:base-connector_class.php


注:本文中的Hook::Exec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。