You are here

public function MetatagTestBase::getTranslationsByContext in Metatag 7

Get the {locales_source} lid values for a specific context.

Parameters

string $context: The context string to search for.

string $textgroup: This string's textgroup; defaults to 'metatag'.

Return value

int The {locales_source}.lid value for this string.

2 calls to MetatagTestBase::getTranslationsByContext()
MetatagCoreWithI18nOutputTest::testI18nOutputTranslationsDisabled in tests/MetatagCoreWithI18nOutputTest.test
Verify that no output translation records are generated when it's disabled.
MetatagCoreWithI18nOutputTest::testI18nOutputTranslationsEnabled in tests/MetatagCoreWithI18nOutputTest.test
Test translations of the output tags.

File

tests/MetatagTestBase.test, line 414
A base class for the Metatag tests, provides shared methods.

Class

MetatagTestBase
A base class for the Metatag tests, provides shared methods.

Code

public function getTranslationsByContext($context, $textgroup = 'metatag') {
  return db_query("SELECT lid\n      FROM {locales_source}\n      WHERE textgroup = :textgroup\n      AND context = :context", array(
    ':textgroup' => $textgroup,
    ':context' => $context,
  ))
    ->fetchCol();
}