You are here

function PathAliasTest::getPID in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/path/src/Tests/PathAliasTest.php \Drupal\path\Tests\PathAliasTest::getPID()

Returns the path ID.

Parameters

string $alias: A string containing an aliased path.

Return value

int Integer representing the path ID.

1 call to PathAliasTest::getPID()
PathAliasTest::testAdminAlias in core/modules/path/src/Tests/PathAliasTest.php
Tests alias functionality through the admin interfaces.

File

core/modules/path/src/Tests/PathAliasTest.php, line 331
Contains \Drupal\path\Tests\PathAliasTest.

Class

PathAliasTest
Add, edit, delete, and change alias and verify its consistency in the database.

Namespace

Drupal\path\Tests

Code

function getPID($alias) {
  return db_query("SELECT pid FROM {url_alias} WHERE alias = :alias", array(
    ':alias' => $alias,
  ))
    ->fetchField();
}