This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The following code will be published to a production server. | |
* | |
* It's a simple script that allows a customer to view their booking status. | |
* | |
* Find as many errors or flaws as you can. You can edit the code inline, and/or | |
* leave a comment where you think you've found a flaw. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update the Drupal user with new team id | |
*/ | |
public function updateUserTeam($username, $team_id) { | |
//Load user | |
$user = \Drupal::entityTypeManager()->getStorage('user')->loadByProperties([ | |
'name' => $username, | |
]); | |