Skip to content
Snippets Groups Projects

deprecating Drupal\Core\Database\Connection::prefixTable(table)

4 unresolved threads

deprecating Drupal\Core\Database\Connection::prefixTable(table) and creating Drupal\Core\Database\Connection::getPrefix()

Closes #3257201

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
357 357 public function attachDatabase(string $database): void {
358 358 }
359 359
360 /**
361 * Returns the prefix of the tables.
362 *
363 * @return string $prefix
364 */
365 public function getPrefix() {
  • daffie
  • 452 461 *
    453 462 * @param string $table
    454 463 * (optional) The table to find the prefix for.
    464 *
    465 * @deprecated in drupal:10.0.0 and is removed from drupal:11.0.0.
    466 * Instead, you should just use Connection::getPrefix().
    467 *
    468 * @see https://www.drupal.org/node/3260849
    455 469 */
    456 470 public function tablePrefix($table = 'default') {
    471 @trigger_error('Connection::tablePrefix() is deprecated in drupal:10.0.0 and is
  • Ravi Shankar added 1 commit

    added 1 commit

    • 2ab26ef1 - Issue #3257201: Replaced tablePrefix methods uses with getPrefix method in core.

    Compare with previous version

  • added 82 commits

    • 2ab26ef1...414c7a4c - 80 commits from branch project:10.0.x
    • 3bc32158 - deprecating deprecate Drupal\Core\Database\Connection::prefixTable(table) and...
    • 2bff8aa5 - Issue #3257201: Replaced tablePrefix methods uses with getPrefix method in core.

    Compare with previous version

  • added 1 commit

    • 00f120af - Add deprecation message test, remove the usage of tablePrefix from core

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Ravi Shankar added 1 commit

    added 1 commit

    • 5d2f1bd1 - Added deprecation version to drupal 10.1.x.

    Compare with previous version

  • 363 363 public function attachDatabase(string $database): void {
    364 364 }
    365 365
    366 /**
    367 * Returns the prefix of the tables.
    368 *
    369 * @return string $prefix
    370 */
    371 public function getPrefix(): string {
    • Should this be marked @internal?

    • Since it's used by drivers and migrate, we probably shouldn't? But it's definitely borderline.

    • Lets keep it a public method. The method setPrefix() is also public. I get why we could mark it as internal as it is only used by drivers and migrate. My vote is for making it public, but I can also live with making it internal.

    • Please register or sign in to reply
  • 207 207 $this->assertTrue($this->connection->hasJson());
    208 208 }
    209 209
    210 /**
    211 * Tests deprecation of ::tablePrefix().
    212 *
    213 * @group legacy
    214 */
    215 public function testDeprecatedTablePrefix() {
  • Ravi Shankar added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading