本文整理汇总了PHP中Illuminate\Database\Schema\Builder::getColumnListing方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::getColumnListing方法的具体用法?PHP Builder::getColumnListing怎么用?PHP Builder::getColumnListing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Schema\Builder
的用法示例。
在下文中一共展示了Builder::getColumnListing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getColumnsOnCache
/**
* To get all columns on caching
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return array
*/
protected function getColumnsOnCache(Model $model)
{
/**
* In normal scenario tables and columns often is not changed.
* Therefore every time it is not need to access the database for knowing
* columns name. We don't want make preoccupy/busy to the database.
*/
$fullKey = $this->getFullName($model);
return $this->cache->remember($fullKey, $this->getRememberTime(), function () use($model) {
return $this->builder->getColumnListing($model->getTable());
});
}
示例2: getMissingUpdateAttributes
/**
* POST and PUT requests must contain all attributes.
* This method returns all fillable attributes which are missing.
*
* @param Model $model
* @return array
*/
protected function getMissingUpdateAttributes(Model $model)
{
$keys = array_keys($this->body->getArray());
$columnNames = $this->schemaBuilder->getColumnListing($model->getTable());
$attributes = [];
foreach ($columnNames as $column) {
if ($model->isFillable($column) && !in_array($column, $keys)) {
$attributes[] = $column;
}
}
return $attributes;
}
示例3: getColumnListing
/**
* Get the column listing for a given table.
*
* @param string $table
* @return array
* @static
*/
public static function getColumnListing($table)
{
return \Illuminate\Database\Schema\Builder::getColumnListing($table);
}
示例4: getColumnListing
/**
* Get the column listing for a given table.
*
* @param string $table
*
* @return array
*/
public function getColumnListing($table)
{
return static::$schema->getColumnListing($table);
}