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


PHP DB::getSchemaBuilder方法代码示例

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


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

示例1: getSchemaBuilder

 /**
  * Get the schema builder instance.
  *
  * @return \Illuminate\Database\Schema\Builder
  */
 public function getSchemaBuilder()
 {
     if (is_null($this->schema)) {
         $this->schema = DB::getSchemaBuilder();
     }
     return $this->schema;
 }
开发者ID:ymnl007,项目名称:laravel-fk-migration,代码行数:12,代码来源:Migration.php

示例2: toCsv

 /**
  * "league/csv": "^8.0"
  *
  * use League\Csv\Reader;
  * use League\Csv\Writer;
  * use Illuminate\Database\Schema\Builder as Schema;
  *
  * @param null $tableName
  */
 public function toCsv($tableName = null)
 {
     $data = DB::table($tableName)->get();
     $csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject());
     $csv->insertOne(DB::getSchemaBuilder()->getColumnListing($tableName));
     foreach ($data as $datum) {
         $datum = json_encode($datum);
         $csv->insertOne($datum);
     }
     $csv->output('out.csv');
 }
开发者ID:petrovitch,项目名称:smoothing,代码行数:20,代码来源:RecipesController.php

示例3: getCustomFields

 public function getCustomFields()
 {
     // Get all fields of the custom table
     $fields = DB::getSchemaBuilder()->getColumnListing('custom_' . $this->list_id);
     // remove id and record_id fields
     if (($key = array_search('id', $fields)) !== false) {
         unset($fields[$key]);
     }
     if (($key = array_search('record_id', $fields)) !== false) {
         unset($fields[$key]);
     }
     return $fields;
 }
开发者ID:encry2024,项目名称:nsi-crm-healthcare,代码行数:13,代码来源:Record.php

示例4: getTableColumns

 public function getTableColumns($table_name)
 {
     return DB::getSchemaBuilder()->getColumnListing($table_name);
 }
开发者ID:CodeForAfricaLabs,项目名称:ProjectTracker,代码行数:4,代码来源:ProjectTrackerController.php

示例5: setFilterableFields

 /**
  * @param \Illuminate\Database\Eloquent\Builder $builder
  */
 public function setFilterableFields(\Illuminate\Database\Eloquent\Builder $builder)
 {
     $table = $builder->getModel()->getTable();
     $columns = DB::getSchemaBuilder()->getColumnListing($table);
     foreach ($columns as $col) {
         $this->filterableFields[$col] = $col;
     }
 }
开发者ID:johnrich85,项目名称:eloquent-query-modifier,代码行数:11,代码来源:InputConfig.php

示例6: pegaColunasTabela

 public function pegaColunasTabela($tabela)
 {
     $cons = DB::getSchemaBuilder()->getColumnListing($tabela);
     return $cons;
 }
开发者ID:felipemouradev,项目名称:pumpkin_scissors,代码行数:5,代码来源:GeraForm.php


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