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


PHP Module::className方法代码示例

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


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

示例1: beforeUpdateCallback

 public function beforeUpdateCallback($e)
 {
     if ($this->isAttributeChanged('canceled')) {
         $this->canceled_at = \Yii::$app->formatter->asTimestamp(time());
     }
     if ($this->isAttributeChanged('payed')) {
         $this->payed_at = \Yii::$app->formatter->asTimestamp(time());
     }
     if ($this->isAttributeChanged('status_code')) {
         $this->status_at = \Yii::$app->formatter->asTimestamp(time());
         (new ShopOrderChange(['type' => ShopOrderChange::ORDER_STATUS_CHANGED, 'shop_order_id' => $this->id, 'data' => ['status' => $this->status->name]]))->save();
         //Письмо тому кто заказывает
         if ($this->user->email) {
             try {
                 \Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
                 \Yii::$app->mailer->compose('order-status-change', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Change order status') . ' #' . $this->id)->send();
             } catch (\Exception $e) {
                 \Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
             }
         }
     }
     if ($this->isAttributeChanged('allow_payment') && $this->allow_payment == Cms::BOOL_Y) {
         (new ShopOrderChange(['type' => ShopOrderChange::ORDER_ALLOW_PAYMENT, 'shop_order_id' => $this->id]))->save();
         //Письмо тому кто заказывает
         if ($this->user->email) {
             try {
                 \Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
                 \Yii::$app->mailer->compose('order-allow-payment', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Resolution of payment on request') . ' #' . $this->id)->send();
             } catch (\Exception $e) {
                 \Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
             }
         }
     }
     if ($this->isAttributeChanged('allow_delivery') && $this->allow_delivery == Cms::BOOL_Y) {
         (new ShopOrderChange(['type' => ShopOrderChange::ORDER_ALLOW_DELIVERY, 'shop_order_id' => $this->id]))->save();
         //Письмо тому кто заказывает
         if ($this->user->email) {
             try {
                 \Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
                 \Yii::$app->mailer->compose('order-allow-delivery', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Resolution of payment on request') . ' #' . $this->id)->send();
             } catch (\Exception $e) {
                 \Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
             }
         }
     }
     if ($this->isAttributeChanged('canceled') && $this->canceled == Cms::BOOL_Y) {
         (new ShopOrderChange(['type' => ShopOrderChange::ORDER_CANCELED, 'shop_order_id' => $this->id, 'data' => ['reason_canceled' => $this->reason_canceled]]))->save();
         //Письмо тому кто заказывает
         if ($this->user->email) {
             try {
                 \Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
                 \Yii::$app->mailer->compose('order-canceled', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Cancellations') . ' #' . $this->id)->send();
             } catch (\Exception $e) {
                 \Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
             }
         }
     }
 }
开发者ID:skeeks-cms,项目名称:cms-shop,代码行数:58,代码来源:ShopOrder.php


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