Skip to content

Commit

Permalink
Return the language that was created.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Jun 26, 2015
1 parent 509b145 commit dcaf406
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Drupal/DrupalExtension/Context/RawDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,18 @@ public function termCreate($term) {
* @param \stdClass $language
* An object with the following properties:
* - langcode: the langcode of the language to create.
*
* @return object|FALSE
* The created language, or FALSE if the language was already created.
*/
public function languageCreate(\stdClass $language) {
$this->dispatchHooks('BeforeLanguageCreateScope', $language);
$this->getDriver()->languageCreate($language);
$this->dispatchHooks('AfterLanguageCreateScope', $language);
$this->languages[$language->langcode] = $language;
$language = $this->getDriver()->languageCreate($language);
if ($language) {
$this->dispatchHooks('AfterLanguageCreateScope', $language);
$this->languages[$language->langcode] = $language;
}
return $language;
}

/**
Expand Down

0 comments on commit dcaf406

Please sign in to comment.