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


PHP Notify::setNotifyDisable方法代码示例

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


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

示例1: delete

 /**
  * Delete order.
  *
  * @param int $id				Order id.
  * @return Result
  * @throws Main\ArgumentNullException
  */
 public static function delete($id)
 {
     $result = new Result();
     if (!($order = Order::load($id))) {
         $result->addError(new ResultError(Loc::getMessage('SALE_ORDER_ENTITY_NOT_FOUND'), 'SALE_ORDER_ENTITY_NOT_FOUND'));
         return $result;
     }
     Notify::setNotifyDisable(true);
     /** @var Result $r */
     $r = $order->setField('CANCELED', 'Y');
     if (!$r->isSuccess()) {
         $result->addErrors($r->getErrors());
         return $result;
     }
     /** @var Basket $basketCollection */
     if ($basketCollection = $order->getBasket()) {
         /** @var BasketItem $basketItem */
         foreach ($basketCollection as $basketItem) {
             $basketItem->delete();
         }
     }
     /** @var ShipmentCollection $shipmentCollection */
     if ($shipmentCollection = $order->getShipmentCollection()) {
         /** @var Shipment $shipment */
         foreach ($shipmentCollection as $shipment) {
             $shipment->delete();
         }
     }
     /** @var PaymentCollection $paymentCollection */
     if ($paymentCollection = $order->getPaymentCollection()) {
         /** @var Payment $payment */
         foreach ($paymentCollection as $payment) {
             $payment->delete();
         }
     }
     /** @var PropertyValueCollection $propertyCollection */
     if ($propertyCollection = $order->getPropertyCollection()) {
         /** @var PropertyValue $property */
         foreach ($propertyCollection as $property) {
             $property->delete();
         }
     }
     $event = new Main\Event('sale', EventActions::EVENT_ON_BEFORE_ORDER_DELETE, array('ENTITY' => $order));
     $event->send();
     foreach ($event->getResults() as $eventResult) {
         $return = null;
         if ($eventResult->getType() == Main\EventResult::ERROR) {
             continue;
         }
         if ($eventResult->getType() == Main\EventResult::SUCCESS) {
             $return = $eventResult->getParameters('return');
             if ($return !== null) {
                 return $result;
             }
         }
     }
     /** @var Result $r */
     $r = $order->save();
     if ($r->isSuccess()) {
         /** @var Entity\DeleteResult $r */
         $r = Internals\OrderTable::delete($id);
         if ($r->isSuccess()) {
             OrderHistory::deleteByOrderId($id);
         }
     } else {
         $result->addErrors($r->getErrors());
     }
     Notify::setNotifyDisable(false);
     $event = new Main\Event('sale', EventActions::EVENT_ON_ORDER_DELETED, array('ENTITY' => $order, 'VALUE' => (bool) $r->isSuccess()));
     $event->send();
     return $result;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:79,代码来源:order.php


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