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


PHP unknown::has方法代码示例

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


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

示例1: paginate

 /**
  * Paginate the given criteria
  * @param Builder $criteria
  * @param unknown $columns
  * @return \App\Core\PaginatorCore
  */
 public function paginate($criteria, $columns = ['*'])
 {
     if ($criteria instanceof Illuminate\Database\Eloquent\Builder) {
         $builder = $criteria->getQuery();
     } else {
         $builder = $criteria;
     }
     $pageName = 'page';
     $sortColumn = '';
     $sortOrder = '';
     $default = config('system.page_limit');
     $total = $builder->getCountForPagination();
     if (!is_null($this->request) && $this->request->has('page_limit')) {
         $perPage = $this->request->has('page_limit') ? $this->request->get('page_limit') : $default;
         $page = $this->request->has($pageName) ? $this->request->get($pageName) : null;
         $sortColumn = $this->request->has('sort') ? $this->request->get('sort') : '';
         $sortOrder = $this->request->has('order') ? $this->request->get('order') : '';
     } else {
         $perPage = $default;
     }
     $builder->forPage($page = Paginator::resolveCurrentPage($pageName), $perPage);
     if ($sortColumn) {
         $sortOrder = $sortOrder ? $sortOrder : $this->defaultSort;
         $criteria = $builder->orderBy($sortColumn, $sortOrder);
     }
     return new PaginatorCore($builder->get($columns), $total, $perPage, $page, ['path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, 'sortColumn' => $sortColumn, 'sortOrder' => $sortOrder]);
 }
开发者ID:atudz,项目名称:SFAReport,代码行数:33,代码来源:PresenterCore.php

示例2: has

 /**
  * Check if the locale is available.
  * 
  * @param string $locale
  */
 public function has($locale)
 {
     $this->initStorage();
     // Normalize locale
     $locale = str_replace('_', '-', $locale);
     if ($this->storage->has($locale)) {
         return true;
     }
     // Default locale is always allowed
     if (strcasecmp($locale, $this->getDefaultLocale()) === 0) {
         return true;
     }
     return false;
 }
开发者ID:JPG-Consulting,项目名称:LocaleManager-OLD,代码行数:19,代码来源:LocaleManager.php

示例3: clear

 /**
  * Clear data filter from session
  * @param string $key
  */
 protected function clear($key = '')
 {
     $data = $this->session->get('filters');
     if ($this->request->has('clear_filter')) {
         if (isset($data[$this->request->getPathInfo()])) {
             $this->session->set('filters.' . $this->request->getPathInfo(), '');
         }
     } elseif ($key) {
         if (isset($data[$this->request->getPathInfo()][$key])) {
             unset($data[$this->request->getPathInfo()][$key]);
             $this->session->set('filters', $data);
         }
     }
 }
开发者ID:atudz,项目名称:snapneat,代码行数:18,代码来源:FilterCore.php

示例4: has

 /**
  * Check if the cart has a specific item
  * 
  * @param  string  $itemIdentifier The unique item identifier
  * @return boolean                 Yes or no?
  */
 public function has($itemIdentifier)
 {
     return $this->store->has($itemIdentifier);
 }
开发者ID:rgnevashev,项目名称:cart,代码行数:10,代码来源:Cart.php


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