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


PHP Repository::where方法代码示例

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


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

示例1: where

 /**
  * @param        $column
  * @param        $comparator
  * @param        $value
  * @param null   $function
  * @param string $table
  *
  * @return $this
  */
 public function where($column, $comparator, $value, $function = null, $table = 'self')
 {
     if ($column === 'publication_id') {
         $table = 'publications_authors';
         $this->join($table, 'author_id', '=', 'id');
     }
     parent::where($column, $comparator, $value, $function, $table);
     return $this;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:18,代码来源:AuthorRepository.php

示例2: where

 /**
  * @param        $column
  * @param        $comparator
  * @param        $value
  * @param null   $function
  * @param string $table
  *
  * @return $this
  */
 public function where($column, $comparator, $value, $function = null, $table = 'self')
 {
     if ($column === 'role_id') {
         $table = 'roles_permissions';
         $this->join .= ' LEFT JOIN `roles_permissions` ON (`roles_permissions`.`permission_id` = self.`id`)';
     } else {
         if ($column === 'user_id') {
             $this->select = 'SELECT DISTINCT self.*';
             $table = 'users_roles';
             $this->join .= ' LEFT JOIN `roles_permissions` ON (`roles_permissions`.`permission_id` = self.`id`)';
             $this->join .= ' LEFT JOIN `users_roles` ON (`users_roles`.`role_id` = `roles_permissions`.`role_id`)';
         }
     }
     parent::where($column, $comparator, $value, $function, $table);
     return $this;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:25,代码来源:PermissionRepository.php

示例3: where

 /**
  * @param        $column
  * @param        $comparator
  * @param        $value
  * @param null   $function
  * @param string $table
  *
  * @return $this
  */
 public function where($column, $comparator, $value, $function = null, $table = 'self')
 {
     if ($column === 'author_id') {
         $table = 'publications_authors';
         $this->join($table, 'publication_id', '=', 'id');
     } else {
         if ($column === 'keyword_id') {
             $table = 'publications_keywords';
             $this->join($table, 'publication_id', '=', 'id');
         } else {
             if ($column === 'keyword_name') {
                 $this->join('publications_keywords', 'publication_id', '=', 'id');
                 $this->join .= ' JOIN `keywords` ON (`publications_keywords`.`keyword_id` = `keywords`.`id`)';
                 $table = 'keywords';
                 $column = 'name';
             }
         }
     }
     parent::where($column, $comparator, $value, $function, $table);
     return $this;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:30,代码来源:PublicationRepository.php

示例4: whereRepository

 /**
  * Add the field to query to find the model
  *
  * @param Repository $repository
  *
  * @return Repository
  */
 public function whereRepository($repository)
 {
     return $repository->where($this->getSchema()->getColumn(), $this->getValueRaw());
 }
开发者ID:EchoWine,项目名称:database,代码行数:11,代码来源:Model.php


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