Class lajax\projectscanner\scanners\DbScanner

Inheritancelajax\projectscanner\scanners\DbScanner » yii\base\Object
Implementslajax\projectscanner\scanners\ScannerInterface
Available since version1.0

Detecting existing language elements in database.

The connection ids of the scanned databases and the table/field names can be defined in the configuration file of translateManager examples:

'tables' => [
 [
     'connection' => 'db',
     'table' => 'language',
     'columns' => ['name', 'name_ascii'],
     'category' => 'tableName',
 ],
 [
     'connection' => 'db',
     'table' => 'tag',
     'columns' => ['name'],
     'category' => 'tableName',
 ],
 [
     'connection' => 'db',
     'table' => 'category',
     'columns' => ['name', 'description']
 ]
]

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$category string Default database category. lajax\projectscanner\scanners\DbScanner
$scanner lajax\projectscanner\Scanner Component containing the detected language elements lajax\projectscanner\scanners\DbScanner
$tables array Array containing the table ids to process. lajax\projectscanner\scanners\DbScanner

Public Methods

Hide inherited methods

MethodDescriptionDefined By
execute() Executes the scanning statement. lajax\projectscanner\scanners\DbScanner
init() lajax\projectscanner\scanners\DbScanner

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getCategory() Returns the language category. lajax\projectscanner\scanners\DbScanner
normalizeTablename() Returns the normalized database table name. lajax\projectscanner\scanners\DbScanner
scanTable() Scanning database table lajax\projectscanner\scanners\DbScanner

Property Details

$category public property

Default database category.

public string $category 'database'
$scanner public property

Component containing the detected language elements

$tables public property

Array containing the table ids to process.

public array $tables null

Method Details

execute() public method

Executes the scanning statement.

public void execute ( )
getCategory() protected method

Returns the language category.

protected string getCategory ( $tables )
$tables array
init() public method

public void init ( )
normalizeTablename() protected method

Returns the normalized database table name.

protected string normalizeTablename ( $tableName )
$tableName string

Database table name.

scanTable() protected method

Scanning database table

protected void scanTable ( $tables )
$tables array