public function FeatureContext::getGroupIdFromTitle in Open Social 8.4
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 8.6 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
- 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getGroupIdFromTitle()
Parameters
$group_title:
Return value
null
2 calls to FeatureContext::getGroupIdFromTitle()
- FeatureContext::iSelectGroup in tests/
behat/ features/ bootstrap/ FeatureContext.php - @When I select group :group
- FeatureContext::openGroupStreamPage in tests/
behat/ features/ bootstrap/ FeatureContext.php - Opens group stream page.
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 595
Class
- FeatureContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function getGroupIdFromTitle($group_title) {
$query = \Drupal::entityQuery('group')
->condition('label', $group_title);
$group_ids = $query
->execute();
$groups = entity_load_multiple('group', $group_ids);
if (count($groups) > 1) {
return NULL;
}
else {
$group = reset($groups);
if ($group
->id() !== 0) {
$group_id = $group
->id();
}
}
return $group_id;
}