當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::addWarning方法代碼示例

本文整理匯總了PHP中Eccube\Application::addWarning方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::addWarning方法的具體用法?PHP Application::addWarning怎麽用?PHP Application::addWarning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Eccube\Application的用法示例。


在下文中一共展示了Application::addWarning方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index(Application $app, Request $request)
 {
     // install.phpのチェック.
     if (isset($app['config']['eccube_install']) && $app['config']['eccube_install'] == 1) {
         $file = $app['config']['root_dir'] . '/html/install.php';
         if (file_exists($file)) {
             $app->addWarning('admin.install.warning', 'admin');
         }
     }
     // 受注マスター検索用フォーム
     $searchOrderForm = $app['form.factory']->createBuilder('admin_search_order')->getForm();
     // 商品マスター検索用フォーム
     $searchProductForm = $app['form.factory']->createBuilder('admin_search_product')->getForm();
     // 會員マスター検索用フォーム
     $searchCustomerForm = $app['form.factory']->createBuilder('admin_search_customer')->getForm();
     /**
      * 受注狀況.
      */
     $excludes = array();
     $excludes[] = $app['config']['order_pending'];
     $excludes[] = $app['config']['order_processing'];
     $excludes[] = $app['config']['order_cancel'];
     $excludes[] = $app['config']['order_deliv'];
     // 受注ステータスごとの受注件數.
     $Orders = $this->getOrderEachStatus($app['orm.em'], $excludes);
     // 受注ステータスの一覧.
     $OrderStatuses = $this->findOrderStatus($app['orm.em'], $excludes);
     /**
      * 売り上げ狀況
      */
     $excludes = array();
     $excludes[] = $app['config']['order_processing'];
     $excludes[] = $app['config']['order_cancel'];
     $excludes[] = $app['config']['order_pending'];
     // 今日の売上/件數
     $salesToday = $this->getSalesByDay($app['orm.em'], new \DateTime(), $excludes);
     // 昨日の売上/件數
     $salesYesterday = $this->getSalesByDay($app['orm.em'], new \DateTime('-1 day'), $excludes);
     // 今月の売上/件數
     $salesThisMonth = $this->getSalesByMonth($app['orm.em'], new \DateTime(), $excludes);
     /**
      * ショップ狀況
      */
     // 在庫切れ商品數
     $countNonStockProducts = $this->countNonStockProducts($app['orm.em']);
     // 本會員數
     $countCustomers = $this->countCustomers($app['orm.em']);
     return $app->render('index.twig', array('searchOrderForm' => $searchOrderForm->createView(), 'searchProductForm' => $searchProductForm->createView(), 'searchCustomerForm' => $searchCustomerForm->createView(), 'Orders' => $Orders, 'OrderStatuses' => $OrderStatuses, 'salesThisMonth' => $salesThisMonth, 'salesToday' => $salesToday, 'salesYesterday' => $salesYesterday, 'countNonStockProducts' => $countNonStockProducts, 'countCustomers' => $countCustomers));
 }
開發者ID:ygeneration666,項目名稱:ec,代碼行數:49,代碼來源:AdminController.php

示例2: index

 public function index(Application $app, Request $request)
 {
     // install.phpのチェック.
     if (isset($app['config']['eccube_install']) && $app['config']['eccube_install'] == 1) {
         $file = $app['config']['root_dir'] . '/html/install.php';
         if (file_exists($file)) {
             $message = $app->trans('admin.install.warning', array('installphpPath' => 'html/install.php'));
             $app->addWarning($message, 'admin');
         }
         $fileOnRoot = $app['config']['root_dir'] . '/install.php';
         if (file_exists($fileOnRoot)) {
             $message = $app->trans('admin.install.warning', array('installphpPath' => 'install.php'));
             $app->addWarning($message, 'admin');
         }
     }
     // 受注マスター検索用フォーム
     $searchOrderBuilder = $app['form.factory']->createBuilder('admin_search_order');
     // 商品マスター検索用フォーム
     $searchProductBuilder = $app['form.factory']->createBuilder('admin_search_product');
     // 會員マスター検索用フォーム
     $searchCustomerBuilder = $app['form.factory']->createBuilder('admin_search_customer');
     $event = new EventArgs(array('searchOrderBuilder' => $searchOrderBuilder, 'searchProductBuilder' => $searchProductBuilder, 'searchCustomerBuilder' => $searchCustomerBuilder), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_ADMIM_INDEX_INITIALIZE, $event);
     // 受注マスター検索用フォーム
     $searchOrderForm = $searchOrderBuilder->getForm();
     // 商品マスター検索用フォーム
     $searchProductForm = $searchProductBuilder->getForm();
     // 會員マスター検索用フォーム
     $searchCustomerForm = $searchCustomerBuilder->getForm();
     /**
      * 受注狀況.
      */
     $excludes = array();
     $excludes[] = $app['config']['order_pending'];
     $excludes[] = $app['config']['order_processing'];
     $excludes[] = $app['config']['order_cancel'];
     $excludes[] = $app['config']['order_deliv'];
     $event = new EventArgs(array('excludes' => $excludes), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_ADMIM_INDEX_ORDER, $event);
     // 受注ステータスごとの受注件數.
     $Orders = $this->getOrderEachStatus($app['orm.em'], $excludes);
     // 受注ステータスの一覧.
     $OrderStatuses = $this->findOrderStatus($app['orm.em'], $excludes);
     /**
      * 売り上げ狀況
      */
     $excludes = array();
     $excludes[] = $app['config']['order_processing'];
     $excludes[] = $app['config']['order_cancel'];
     $excludes[] = $app['config']['order_pending'];
     $event = new EventArgs(array('excludes' => $excludes), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_ADMIM_INDEX_SALES, $event);
     // 今日の売上/件數
     $salesToday = $this->getSalesByDay($app['orm.em'], new \DateTime(), $excludes);
     // 昨日の売上/件數
     $salesYesterday = $this->getSalesByDay($app['orm.em'], new \DateTime('-1 day'), $excludes);
     // 今月の売上/件數
     $salesThisMonth = $this->getSalesByMonth($app['orm.em'], new \DateTime(), $excludes);
     /**
      * ショップ狀況
      */
     // 在庫切れ商品數
     $countNonStockProducts = $this->countNonStockProducts($app['orm.em']);
     // 本會員數
     $countCustomers = $this->countCustomers($app['orm.em']);
     $event = new EventArgs(array('Orders' => $Orders, 'OrderStatuses' => $OrderStatuses, 'salesThisMonth' => $salesThisMonth, 'salesToday' => $salesToday, 'salesYesterday' => $salesYesterday, 'countNonStockProducts' => $countNonStockProducts, 'countCustomers' => $countCustomers), $request);
     $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_ADMIM_INDEX_COMPLETE, $event);
     return $app->render('index.twig', array('searchOrderForm' => $searchOrderForm->createView(), 'searchProductForm' => $searchProductForm->createView(), 'searchCustomerForm' => $searchCustomerForm->createView(), 'Orders' => $Orders, 'OrderStatuses' => $OrderStatuses, 'salesThisMonth' => $salesThisMonth, 'salesToday' => $salesToday, 'salesYesterday' => $salesYesterday, 'countNonStockProducts' => $countNonStockProducts, 'countCustomers' => $countCustomers));
 }
開發者ID:ec-cube,項目名稱:ec-cube,代碼行數:69,代碼來源:AdminController.php


注:本文中的Eccube\Application::addWarning方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。