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


PHP Brand::fetchOne方法代码示例

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


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

示例1: stackTracesAction

 public function stackTracesAction()
 {
     $brandId = (int) Url::getVar('brand_id');
     if ($brandId <= 0) {
         Application::throwError(400, 'Bad request');
     }
     $brand = Brand::fetchOne($brandId);
     if ($brand === false) {
         Application::throwError(404, 'Can not find brand');
     }
     $title = 'Stack traces for ' . $brand->name;
     $elements = array();
     $elements[] = Bootstrap::row()->add(12, Bootstrap::h(1, $title)->secondaryText("Total {$brand->total} reports"));
     $elements[] = Bootstrap::row()->add(12, BootstrapUI::tableRemote()->title('Most common stack traces')->column('total', 'count', 80)->column('summary', 'stack trace summary')->column('action', '', 30)->sortableColumns(array('summary', 'total'))->sortField('total', 'desc')->extraParam('brand_id', $brandId));
     return View::create('base')->with('title', $title)->with('content', $elements);
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:16,代码来源:BrandsController.php

示例2: searchAction

 public function searchAction()
 {
     $title = 'Search results';
     if (sizeof(Input::get()) == 1) {
         if (Input::hasGet('provider_id')) {
             $e = Provider::fetchOne(Input::get('provider_id'));
             $title = "Search results for internet provider <strong>{$e->name}</strong>";
         } else {
             if (Input::hasGet('brand_id')) {
                 $e = Brand::fetchOne(Input::get('brand_id'));
                 $title = "Search results for brand <strong>{$e->name}</strong>";
             } else {
                 if (Input::hasGet('package_id')) {
                     $e = Package::fetchOne(Input::get('package_id'));
                     $title = "Search results for package <strong>{$e->name}</strong>";
                 } else {
                     if (Input::hasGet('package_version_id')) {
                         $e = Package\Version::fetchOne(Input::get('package_version_id'));
                         $p = Package::fetchOne($e->package_id);
                         $title = "Search results for <strong>{$p->name}</strong> version {$e->value}";
                     }
                 }
             }
         }
     }
     $packageId = (int) Input::get('package_id');
     $packageVersionId = (int) Input::get('package_version_id');
     $brandId = (int) Input::get('brand_id');
     $osVersionId = (int) Input::get('os_version_id');
     $countryId = (int) Input::get('country_id');
     $providerId = (int) Input::get('provider_id');
     $productId = (int) Input::get('product_id');
     $modelId = (int) Input::get('model_id');
     $dateFrom = Input::get('date_from');
     $dateTo = Input::get('date_to');
     $stackTraceId = (int) Input::get('stack_trace_id');
     $table = BootstrapUI::tableRemote()->title($title)->extraParams(array('package_id' => $packageId, 'package_version_id' => $packageVersionId, 'brand_id' => $brandId, 'os_version_id' => $osVersionId, 'country_id' => $countryId, 'provider_id' => $providerId, 'product_id' => $productId, 'model_id' => $modelId, 'date_from' => $dateFrom, 'date_to' => $dateTo, 'stack_trace_id' => $stackTraceId))->column('country_name', '', 20)->column('created_at', 'time', 85)->column('package_name', 'package')->column('package_version', 'version')->column('brand_name', 'brand')->column('os_version_name', 'OS version', 105)->column('country', '')->column('action', '', 30)->sortableColumns(array('created_at', 'package_name', 'package_version', 'brand_name', 'os_version_name', 'cnt'))->sortField('created_at', 'desc');
     $table->panel()->addHeaderElement(Bootstrap::button('Back')->color('red')->size('xs')->setAttribute('onclick', 'window.history.back()'));
     return View::create('base')->with('title', $title)->with('content', Bootstrap::row()->add(12, $table));
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:40,代码来源:ReportsController.php


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