function CustomBreadcrumbsFeaturesMachineNamesTestCase::getMachineName in Custom Breadcrumbs Features 7.2
Helper - Get a breadcrumb machine name.
Parameters
$cb_type: Breadcrumb type.
$name: Breadcrumb name.
Return value
Breadcrumb machine name, or FALSE if none was found.
2 calls to CustomBreadcrumbsFeaturesMachineNamesTestCase::getMachineName()
- CustomBreadcrumbsFeaturesMachineNamesTestCase::assertMachineName in tests/
machine_names.test - Helper - Assert a crumb has a machine name.
- CustomBreadcrumbsFeaturesMachineNamesTestCase::assertNoMachineName in tests/
machine_names.test - Helper - Assert a crumb has no machine name.
File
- tests/
machine_names.test, line 171 - Test that custom_breadcrumbs_features provides allows crumbs to have a machine name.
Class
- CustomBreadcrumbsFeaturesMachineNamesTestCase
- Test that Custom Breadcrumbs can be associated with machine names.
Code
function getMachineName($cb_type, $name) {
$crumb = db_select($cb_type, 'cb')
->fields('cb')
->condition('name', $name)
->execute()
->fetchAssoc();
return empty($crumb['machine_name']) ? FALSE : $crumb['machine_name'];
}