Schema
in package
Class Schema
Manage the entire database. This is useful for destroying or loading the schema.
Table of Contents
Methods
- dropAll() : mixed
- getTables() : array<string|int, mixed>
- loadSnapshot() : Schema
- Load a snapshot into CiviCRM's database.
- setAutoIncrement() : Schema
- This sets the AUTO_INCREMENT to flush out tests or code that muddle ids of test entities but pass because the ids are all low starting at 1
- setStrict() : mixed
- truncateAll() : Schema
- createMysqlDefaultsFile() : string
- When calling "mysql" subprocess, it helps to put DB credentials into "my.cnf"-style file.
Methods
dropAll()
public
dropAll() : mixed
getTables()
public
getTables(string $type) : array<string|int, mixed>
Parameters
- $type : string
-
'BASE TABLE' or 'VIEW'.
Return values
array<string|int, mixed>loadSnapshot()
Load a snapshot into CiviCRM's database.
public
loadSnapshot(string $file) : Schema
Parameters
- $file : string
-
Ex: '/path/to/civicrm-4.5.6-foobar.sql.bz2' or '/path/to/civicrm-4.5.6-foobar.mysql.gz'
Return values
SchemasetAutoIncrement()
This sets the AUTO_INCREMENT to flush out tests or code that muddle ids of test entities but pass because the ids are all low starting at 1
public
setAutoIncrement() : Schema
Return values
SchemasetStrict()
public
setStrict(mixed $checks) : mixed
Parameters
- $checks : mixed
truncateAll()
public
truncateAll() : Schema
Return values
SchemacreateMysqlDefaultsFile()
When calling "mysql" subprocess, it helps to put DB credentials into "my.cnf"-style file.
protected
createMysqlDefaultsFile(array<string|int, mixed> $dsn) : string
Parameters
- $dsn : array<string|int, mixed>
Return values
string —Path to the new "my.cnf" file.