當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。