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


PHP type::with方法代码示例

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


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

示例1: scopeCategorized

 /**
  * By Category
  * @param type $query
  * @param \Claremontdesign\Ecommerce\Model\Category $category
  * @return type
  */
 public function scopeCategorized($query, Category $category = null)
 {
     if (is_null($category)) {
         return $query->with(cd_config('database.e.productCategory.table.name'));
     }
     $categoryIds = $category->getDescendantsAndSelf()->lists(cd_config('database.e.productCategory.table.primary'));
     return $query->with('categories')->join(cd_config('database.e.productCategoryPivot.table.name'), cd_config('database.e.productCategoryPivot.table.name') . '.' . cd_config('database.e.product.table.primary'), '=', cd_config('database.e.product.table.name') . '.' . cd_config('database.e.product.table.primary'))->whereIn(cd_config('database.e.productCategoryPivot.table.name') . '.' . cd_config('database.e.productCategory.table.primary'), $categoryIds);
 }
开发者ID:claremontdesign,项目名称:cdecommerce,代码行数:14,代码来源:Product.php

示例2: update

 /**
  * 
  * @param array $data
  * @param type $id
  * @return type
  */
 public function update(array $data, $id)
 {
     try {
         $this->validator->with($data)->passesOrFail();
         return $this->repository->update($data, $id);
     } catch (ValidatorException $e) {
         return ['error' => 'true', 'messege' => $e->getMessageBag()];
     } catch (\Exception $e) {
         return ['error' => 'true', 'messege' => "Usuário não encontrado!"];
     }
 }
开发者ID:mariosas,项目名称:plusf,代码行数:17,代码来源:UserServices.php

示例3: index

 /**
  * 
  * @return type
  */
 public function index()
 {
     //$vendas = $this->vendas->join('clientes', 'vendas.cliente_id', '=', 'clientes.id')->select('clientes.nome')->get();
     $vendas = $this->repository->with(['cliente', 'produto'])->all();
     return view('painel::paginas.vendas', compact('vendas'));
 }
开发者ID:mariosas,项目名称:plusf,代码行数:10,代码来源:VendasController.php

示例4: compose

 /**
  * News and Version shared view variables
  * @param type $view
  */
 public function compose($view)
 {
     $view->with('senApiVersion', (new \Sentora\Providers\SentoraPublicApi())->latestStableVersion());
     $view->with('senApiNews', (new \Sentora\Providers\SentoraPublicApi())->lastestNews());
 }
开发者ID:proxymoron,项目名称:website,代码行数:9,代码来源:NewsVersionComposer.php


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