eZ\Publish\Core\SignalSlot\UserService::createUser PHP Method

createUser() public method

Create a new user. The created user is published by this method.
public createUser ( eZ\Publish\API\Repository\Values\User\UserCreateStruct $userCreateStruct, array $parentGroups ) : eZ\Publish\API\Repository\Values\User\User
$userCreateStruct eZ\Publish\API\Repository\Values\User\UserCreateStruct the data used for creating the user
$parentGroups array the groups of type {@link \eZ\Publish\API\Repository\Values\User\UserGroup} which are assigned to the user after creation
return eZ\Publish\API\Repository\Values\User\User
    public function createUser(UserCreateStruct $userCreateStruct, array $parentGroups)
    {
        $returnValue = $this->service->createUser($userCreateStruct, $parentGroups);
        $this->signalDispatcher->emit(new CreateUserSignal(array('userId' => $returnValue->id)));
        return $returnValue;
    }