Created
May 5, 2011 09:16
-
-
Save skurfuerst/956774 to your computer and use it in GitHub Desktop.
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
$account = new \F3\FLOW3\Security\Account(); | |
$account->setAccountIdentifier($accountJson->username); | |
$person = new Person(); | |
$firstnameAndLastname = explode(' ', $accountJson->name, 2); | |
$firstName = ''; | |
$lastName = ''; | |
if (isset($firstnameAndLastname[0])) { | |
$firstName = $firstnameAndLastname[0]; | |
} | |
if (isset($firstnameAndLastname[1])) { | |
$lastName = $firstnameAndLastname[1]; | |
} | |
$person->setName(new PersonName('', $firstName, $lastName)); | |
$electronicAddress = new ElectronicAddress(); | |
$electronicAddress->setIdentifier($accountJson->email); | |
$electronicAddress->setType(ElectronicAddress::TYPE_EMAIL); | |
$electronicAddress->setUsage(ElectronicAddress::USAGE_WORK); | |
$person->setPrimaryElectronicAddress($electronicAddress); | |
$account->setParty($person); | |
$this->accountRepository->add($account); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added editing of a name to the blog with this commit:
http://git.typo3.org/FLOW3/Packages/Blog.git?a=commitdiff;h=6719d882f9186830adbe5c3f92795ecb4a41d15f