public function createFrontEndUser(
        $frontEndUserGroups = '',
        array $recordData = []
    ) {
        $frontEndUserGroupsWithoutSpaces = str_replace(' ', '', $frontEndUserGroups);

        if ($frontEndUserGroupsWithoutSpaces === '') {
            $frontEndUserGroupsWithoutSpaces = $this->createFrontEndUserGroup();
        }
        if (!preg_match('/^(?:[1-9]+\\d*,?)+$/', $frontEndUserGroupsWithoutSpaces)
        ) {
            throw new \InvalidArgumentException(
                '$frontEndUserGroups must contain a comma-separated list of UIDs. Each UID must be > 0.',
                1334439059
            );
        }
        if (isset($recordData['uid'])) {
            throw new \InvalidArgumentException('The column "uid" must not be set in $recordData.', 1334439065);
        }
        if (isset($recordData['usergroup'])) {
            throw new \InvalidArgumentException('The column "usergroup" must not be set in $recordData.', 1334439071);
        }

        $completeRecordData = $recordData;
        $completeRecordData['usergroup'] = $frontEndUserGroupsWithoutSpaces;

        return $this->createRecordWithoutTableNameChecks('fe_users', $completeRecordData);
    }
public function createFrontEndUser(
        $frontEndUserGroups = '',
        array $recordData = []
    ) {
        $frontEndUserGroupsWithoutSpaces = str_replace(' ', '', $frontEndUserGroups);

        if ($frontEndUserGroupsWithoutSpaces === '') {
            $frontEndUserGroupsWithoutSpaces = $this->createFrontEndUserGroup();
        }
        if (!preg_match('/^(?:[1-9]+\\d*,?)+$/', $frontEndUserGroupsWithoutSpaces)
        ) {
            throw new \InvalidArgumentException(
                '$frontEndUserGroups must contain a comma-separated list of UIDs. Each UID must be > 0.',
                1334439059
            );
        }
        if (isset($recordData['uid'])) {
            throw new \InvalidArgumentException('The column "uid" must not be set in $recordData.', 1334439065);
        }
        if (isset($recordData['usergroup'])) {
            throw new \InvalidArgumentException('The column "usergroup" must not be set in $recordData.', 1334439071);
        }

        $completeRecordData = $recordData;
        $completeRecordData['usergroup'] = $frontEndUserGroupsWithoutSpaces;

        return $this->createRecordWithoutTableNameChecks('fe_users', $completeRecordData);
    }
public function createFrontEndUser ( $ frontEndUserGroups = '' , array $ recordData = [ ] ) { $ frontEndUserGroupsWithoutSpaces = str_replace ( ' ' , '' , $ frontEndUserGroups ) ; if ( $ frontEndUserGroupsWithoutSpaces === '' ) { $ frontEndUserGroupsWithoutSpaces = $ this -> createFrontEndUserGroup ( ) ; } if ( ! preg_match ( '/^(?:[1-9]+\\d*,?)+$/' , $ frontEndUserGroupsWithoutSpaces ) ) { throw new \ InvalidArgumentException ( '$frontEndUserGroups must contain a comma-separated list of UIDs. Each UID must be > 0.' , 1334439059 ) ; } if ( isset ( $ recordData [ 'uid' ] ) ) { throw new \ InvalidArgumentException ( 'The column "uid" must not be set in $recordData.' , 1334439065 ) ; } if ( isset ( $ recordData [ 'usergroup' ] ) ) { throw new \ InvalidArgumentException ( 'The column "usergroup" must not be set in $recordData.' , 1334439071 ) ; } $ completeRecordData = $ recordData ; $ completeRecordData [ 'usergroup' ] = $ frontEndUserGroupsWithoutSpaces ; return $ this -> createRecordWithoutTableNameChecks ( 'fe_users' , $ completeRecordData ) ; }
Creates a FE user record.

@param string $frontEndUserGroups
comma-separated list of UIDs of the user groups to which the new
user belongs, each must be > 0, may contain spaces, if empty a new
FE user group will be created
@param array $recordData
associative array that contains the data to save in the new user
record, may be empty, but must not contain the keys "uid" or
"usergroup"

@return int the UID of the new FE user, will be > 0

@throws \InvalidArgumentException
Creates a FE user record .