本文整理汇总了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));
}
示例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));
}