You are here

function PathAliasTest::getPID in MongoDB 8

File

src/Tests/PathAliasTest.php, line 36
Definition of Drupal\mongodb\Tests\PathAliasTest.

Class

PathAliasTest
Tests MongoDB path alias functionality.

Namespace

Drupal\mongodb\Tests

Code

function getPID($alias) {
  $result = \Drupal::service('mongo')
    ->get('url_alias')
    ->findOne(array(
    'alias' => $alias,
  ), array(
    '_id' => TRUE,
  ));
  if (!empty($result)) {
    return $result['_id'];
  }
  return FALSE;
}