class PrefixHandler in DB Maintenance 7.2
Same name and namespace in other branches
- 8 src/Module/Db/PrefixHandler.php \Drupal\db_maintenance\Module\Db\PrefixHandler
- 2.0.x src/Module/Db/PrefixHandler.php \Drupal\db_maintenance\Module\Db\PrefixHandler
PrefixHandler class.
Hierarchy
- class \Drupal\db_maintenance\Module\Db\PrefixHandler
Expanded class hierarchy of PrefixHandler
File
- src/
Module/ Db/ PrefixHandler.php, line 14 - PrefixHandler class.
Namespace
Drupal\db_maintenance\Module\DbView source
class PrefixHandler {
/**
* Returns table prefix.
*/
public static function getPrefix($table) {
$px = \Database::getConnection()
->tablePrefix($table);
// watchdog('db_maintenance', 'Prefix of @table is @px .',
// array('@px' => $px, '@table' => $table), WATCHDOG_DEBUG);
return $px;
}
/**
* Cleans table prefix.
*/
public static function clearPrefix($table) {
$px = self::getPrefix($table);
if (strlen($px) > 0) {
$table_clear = str_replace($px, '', $table);
return $table_clear;
}
return $table;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PrefixHandler:: |
public static | function | Cleans table prefix. | |
PrefixHandler:: |
public static | function | Returns table prefix. |