baserCMS クラスリファレンス

BcDatabaseServiceInterface

BcDatabaseServiceInterface

Table of Contents

Methods

clearAppTableList()  : void
アプリケーションに関連するテーブルリストのキャッシュをクリアする
getAppTableList()  : array<string|int, mixed>
アプリケーションに関連するテーブルリストを取得する
getEncoding()  : string
Gets the database encoding
initSystemData()  : bool
システムデータを初期化する
loadCsv()  : bool
CSVファイルをDBに読み込む
loadCsvToArray()  : false|array<string|int, mixed>
CSVよりデータを配列として読み込む
loadDefaultDataPattern()  : bool
初期データを読み込む
loadSchema()  : bool
スキーマを読み込む
resetAllTables()  : bool
プラグインも含めて全てのテーブルをリセットする
resetTables()  : bool
複数のテーブルをリセットする
truncate()  : bool
テーブルのデータをリセットする
updateSequence()  : mixed
データベースシーケンスをアップデートする
writeCsv()  : bool
DBのデータをCSVファイルとして書きだす
writeSchema()  : string|false
モデル名を指定してスキーマファイルを生成する

Methods

clearAppTableList()

アプリケーションに関連するテーブルリストのキャッシュをクリアする

public clearAppTableList([string $dbConfigKeyName = 'default' ]) : void
Parameters
$dbConfigKeyName : string = 'default'
Tags
checked
noTodo
unitTest

getAppTableList()

アプリケーションに関連するテーブルリストを取得する

public getAppTableList([string $plugin = '' ][, string $dbConfigKeyName = 'default' ]) : array<string|int, mixed>
Parameters
$plugin : string = ''
$dbConfigKeyName : string = 'default'
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

getEncoding()

Gets the database encoding

public getEncoding() : string
Tags
checked
noTodo
unitTest
Return values
string

The database encoding

initSystemData()

システムデータを初期化する

public initSystemData([array<string|int, mixed> $options = [] ]) : bool
Parameters
$options : array<string|int, mixed> = []
Tags
noTodo
checked
unitTest
Return values
bool

loadCsv()

CSVファイルをDBに読み込む

public loadCsv(array<string|int, mixed> $options) : bool
Parameters
$options : array<string|int, mixed>
  • path: 読み込み元のCSVのパス
  • `encoding: CSVファイルのエンコード
Tags
checked
noTodo
unitTest
Return values
bool

loadCsvToArray()

CSVよりデータを配列として読み込む

public loadCsvToArray(string $path[, mixed $encoding = 'auto' ]) : false|array<string|int, mixed>
Parameters
$path : string
$encoding : mixed = 'auto'
Tags
checked
noTodo
unitTest
Return values
false|array<string|int, mixed>

loadDefaultDataPattern()

初期データを読み込む

public loadDefaultDataPattern(string $theme, string $pattern[, string $dbConfigKeyName = 'default' ]) : bool
Parameters
$theme : string
$pattern : string
$dbConfigKeyName : string = 'default'
Tags
checked
noTodo
unitTest
Return values
bool

loadSchema()

スキーマを読み込む

public loadSchema( $options) : bool
Parameters
$options :
Tags
unitTest
unitTest
noTodo
Return values
bool

resetAllTables()

プラグインも含めて全てのテーブルをリセットする

public resetAllTables([mixed $excludes = [] ]) : bool

プラグインは有効となっているもののみ 現在のテーマでないテーマの梱包プラグインを検出できない為

Parameters
$excludes : mixed = []
Tags
noTodo
checked
unitTest
Return values
bool

resetTables()

複数のテーブルをリセットする

public resetTables([string $plugin = 'BaserCore' ][, array<string|int, mixed> $excludes = [] ][, string $dbConfigKeyName = 'default' ]) : bool
Parameters
$plugin : string = 'BaserCore'
$excludes : array<string|int, mixed> = []
$dbConfigKeyName : string = 'default'
Tags
noTodo
checked
unitTest
Return values
bool

truncate()

テーブルのデータをリセットする

public truncate(string $table[, string $dbConfigKeyName = 'default' ]) : bool
Parameters
$table : string
$dbConfigKeyName : string = 'default'
Tags
noTodo
checked
unitTest
Return values
bool

updateSequence()

データベースシーケンスをアップデートする

public updateSequence() : mixed
Tags
noTodo
checked
unitTest

writeCsv()

DBのデータをCSVファイルとして書きだす

public writeCsv(mixed $table, array<string|int, mixed> $options) : bool
Parameters
$table : mixed
$options : array<string|int, mixed>

-path: CSVの出力先となるパス -encoding: 出力エンコーディング -table: テーブル名 -init: id、created、modified を初期化する(初期値:false)

Tags
noTodo
checked
unitTest
Return values
bool

writeSchema()

モデル名を指定してスキーマファイルを生成する

public writeSchema(mixed $table, array<string|int, mixed> $options) : string|false
Parameters
$table : mixed
$options : array<string|int, mixed>
  • path : スキーマファイルの生成場所
Tags
unitTest
unitTest
noTodo
Return values
string|false

スキーマファイルの内容


        
On this page

Search results