當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Builder::from方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Query\Builder::from方法的典型用法代碼示例。如果您正苦於以下問題:PHP Builder::from方法的具體用法?PHP Builder::from怎麽用?PHP Builder::from使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Query\Builder的用法示例。


在下文中一共展示了Builder::from方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: table

 /**
  * Begin a fluent query against a database table.
  *
  * @param  string $table
  *
  * @return \Illuminate\Database\Query\Builder
  */
 public function table($table)
 {
     $processor = $this->getPostProcessor();
     $table = $this->db->prefix . $table;
     $query = new Builder($this, $this->getQueryGrammar(), $processor);
     return $query->from($table);
 }
開發者ID:mirzazeyrek,項目名稱:wp-eloquent,代碼行數:14,代碼來源:Database.php

示例2: from

 /**
  * Set the collection which the query is targeting.
  *
  * @param string $table
  *
  * @return Builder
  */
 public function from($table)
 {
     if ($table) {
         $this->table = r\table($table);
         $this->query->table($table);
     }
     return parent::from($table);
 }
開發者ID:brunojk,項目名稱:laravel-rethinkdb,代碼行數:15,代碼來源:Builder.php

示例3: from

 /**
  * Set the table which the query is targeting.
  *
  * @param string $table
  * @return $this 
  * @static 
  */
 public static function from($table)
 {
     return \Illuminate\Database\Query\Builder::from($table);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php

示例4: setModel

 /**
  * Set a model instance for the model being queried.
  *
  * @param  \Illuminate\Database\Eloquent\Model  $model
  * @return \Illuminate\Database\Eloquent\Builder
  */
 public function setModel(Model $model)
 {
     $this->model = $model;
     $this->query->from($model->getTable());
     return $this;
 }
開發者ID:aysenli,項目名稱:laravel-admin-1,代碼行數:12,代碼來源:Builder.php

示例5: from

 /**
  * Set the collection which the query is targeting.
  *
  * @param  string  $collection
  * @return Builder
  */
 public function from($collection)
 {
     if ($collection) {
         $this->collection = $this->connection->getCollection($collection);
     }
     return parent::from($collection);
 }
開發者ID:progamr,項目名稱:LearningLocker,代碼行數:13,代碼來源:Builder.php

示例6: initNestedQuery

 /**
  * Init nested query for filter.
  *
  * @param QueryBuilder $query
  * @param array $ids
  *
  * @return void
  */
 protected function initNestedQuery(QueryBuilder $query, array $ids)
 {
     $connection = $query->getConnection();
     $keyName = $connection->raw($this->relation->getParent()->getQualifiedKeyName());
     $query->from($this->relation->getTable())->select($connection->raw('1'))->where($this->relation->getForeignKey(), '=', $keyName)->whereIn($this->relation->getOtherKey(), $ids);
 }
開發者ID:guratr,項目名稱:cruddy,代碼行數:14,代碼來源:BelongsToMany.php

示例7: __construct

 /**
  * Create instance
  *
  * @param VirtualConnectionInterface $connector connector
  * @param string                     $table     table name
  * @param bool                       $dynamic   proxy use or disuse
  */
 public function __construct(VirtualConnectionInterface $connector, $table, $dynamic = false)
 {
     /**
      * \Illuminate\Database\Query\Builder 를 만들기 위해서 connection 이 필요하다.
      * Builder 를 미리 생성해야 하는 이슈 때문에 driver 를 혼합해서 사용 할 수 없다.
      * mysql, mssql 을 같이 사용 할 수 없음.
      * default connection 으로 사용되는 driver 만 설정이 가능함.
      */
     /**
      * @param Connection $defaultConnection
      */
     $defaultConnection = $connector->getDefaultConnection();
     $processor = $defaultConnection->getPostProcessor();
     $query = new Builder($connector, $defaultConnection->getQueryGrammar(), $processor);
     $query->from($table);
     $this->connector = $connector;
     $this->query = $query;
     $this->table = $table;
     $this->dynamic = $dynamic;
 }
開發者ID:mint-soft-com,項目名稱:xpressengine,代碼行數:27,代碼來源:DynamicQuery.php


注:本文中的Illuminate\Database\Query\Builder::from方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。