Create user return value description.

@param array $additionalfields some additional field
@return single_structure_description
762443
public static function user_description($additionalfields = array()) {
        $userfields = array(
            'id'    => new external_value(core_user::get_property_type('id'), 'ID of the user'),
            'username'    => new external_value(core_user::get_property_type('username'), 'The username', VALUE_OPTIONAL),
            'firstname'   => new external_value(core_user::get_property_type('firstname'), 'The first name(s) of the user', VALUE_OPTIONAL),
            'lastname'    => new external_value(core_user::get_property_type('lastname'), 'The family name of the user', VALUE_OPTIONAL),
            'fullname'    => new external_value(core_user::get_property_type('firstname'), 'The fullname of the user'),
            'email'       => new external_value(core_user::get_property_type('email'), 'An email address - allow email as root@localhost', VALUE_OPTIONAL),
            'address'     => new external_value(core_user::get_property_type('address'), 'Postal address', VALUE_OPTIONAL),
            'phone1'      => new external_value(core_user::get_property_type('phone1'), 'Phone 1', VALUE_OPTIONAL),
            'phone2'      => new external_value(core_user::get_property_type('phone2'), 'Phone 2', VALUE_OPTIONAL),
            'icq'         => new external_value(core_user::get_property_type('icq'), 'icq number', VALUE_OPTIONAL),
            'skype'       => new external_value(core_user::get_property_type('skype'), 'skype id', VALUE_OPTIONAL),
            'yahoo'       => new external_value(core_user::get_property_type('yahoo'), 'yahoo id', VALUE_OPTIONAL),
            'aim'         => new external_value(core_user::get_property_type('aim'), 'aim id', VALUE_OPTIONAL),
            'msn'         => new external_value(core_user::get_property_type('msn'), 'msn number', VALUE_OPTIONAL),
            'department'  => new external_value(core_user::get_property_type('department'), 'department', VALUE_OPTIONAL),
            'institution' => new external_value(core_user::get_property_type('institution'), 'institution', VALUE_OPTIONAL),
            'idnumber'    => new external_value(core_user::get_property_type('idnumber'), 'An arbitrary ID code number perhaps from the institution', VALUE_OPTIONAL),
            'interests'   => new external_value(PARAM_TEXT, 'user interests (separated by commas)', VALUE_OPTIONAL),
            'firstaccess' => new external_value(core_user::get_property_type('firstaccess'), 'first access to the site (0 if never)', VALUE_OPTIONAL),
            'lastaccess'  => new external_value(core_user::get_property_type('lastaccess'), 'last access to the site (0 if never)', VALUE_OPTIONAL),
            'auth'        => new external_value(core_user::get_property_type('auth'), 'Auth plugins include manual, ldap, etc', VALUE_OPTIONAL),
            'suspended'   => new external_value(core_user::get_property_type('suspended'), 'Suspend user account, either false to enable user login or true to disable it', VALUE_OPTIONAL),
            'confirmed'   => new external_value(core_user::get_property_type('confirmed'), 'Active user: 1 if confirmed, 0 otherwise', VALUE_OPTIONAL),
            'lang'        => new external_value(core_user::get_property_type('lang'), 'Language code such as "en", must exist on server', VALUE_OPTIONAL),
            'calendartype' => new external_value(core_user::get_property_type('calendartype'), 'Calendar type such as "gregorian", must exist on server', VALUE_OPTIONAL),
            'theme'       => new external_value(core_user::get_property_type('theme'), 'Theme name such as "standard", must exist on server', VALUE_OPTIONAL),
            'timezone'    => new external_value(core_user::get_property_type('timezone'), 'Timezone code such as Australia/Perth, or 99 for default', VALUE_OPTIONAL),
            'mailformat'  => new external_value(core_user::get_property_type('mailformat'), 'Mail format code is 0 for plain text, 1 for HTML etc', VALUE_OPTIONAL),
            'description' => new external_value(core_user::get_property_type('description'), 'User profile description', VALUE_OPTIONAL),
            'descriptionformat' => new external_format_value(core_user::get_property_type('descriptionformat'), VALUE_OPTIONAL),
            'city'        => new external_value(core_user::get_property_type('city'), 'Home city of the user', VALUE_OPTIONAL),
            'url'         => new external_value(core_user::get_property_type('url'), 'URL of the user', VALUE_OPTIONAL),
            'country'     => new external_value(core_user::get_property_type('country'), 'Home country code of the user, such as AU or CZ', VALUE_OPTIONAL),
            'profileimageurlsmall' => new external_value(PARAM_URL, 'User image profile URL - small version'),
            'profileimageurl' => new external_value(PARAM_URL, 'User image profile URL - big version'),
            'customfields' => new external_multiple_structure(
                new external_single_structure(
                    array(
                        'type'  => new external_value(PARAM_ALPHANUMEXT, 'The type of the custom field - text field, checkbox...'),
                        'value' => new external_value(PARAM_RAW, 'The value of the custom field'),
                        'name' => new external_value(PARAM_RAW, 'The name of the custom field'),
                        'shortname' => new external_value(PARAM_RAW, 'The shortname of the custom field - to be able to build the field class in the code'),
                    )
                ), 'User custom fields (also known as user profile fields)', VALUE_OPTIONAL),
            'preferences' => new external_multiple_structure(
                new external_single_structure(
                    array(
                        'name'  => new external_value(PARAM_RAW, 'The name of the preferences'),
                        'value' => new external_value(PARAM_RAW, 'The value of the preference'),
                    )
            ), 'Users preferences', VALUE_OPTIONAL)
        );
        if (!empty($additionalfields)) {
            $userfields = array_merge($userfields, $additionalfields);
        }
        return new external_single_structure($userfields);
    }
210126
public function createUser($properties): UserRecord
    {
        $request = $properties instanceof Request\CreateUser
            ? $properties
            : Request\CreateUser::withProperties($properties);

        $response = $this->client->createUser($request);

        $uid = JSON::decode((string) $response->getBody(), true)['localId'];

        return $this->getUser($uid);
    }
94589
public static function create_from_field($field) {
        $event = self::create(array(
            'objectid' => $field->id,
            'context' => \context_system::instance(),
            'other' => array(
                'shortname' => $field->shortname,
                'name'      => $field->name,
                'datatype'  => $field->datatype,
            )
        ));

        $event->add_record_snapshot('user_info_field', $field);

        return $event;
    }
966492
public function create(array $fields)
    {
        $this->assertValidFields($fields);

        $request = new Request('customizations');
        $request->setParams(['fields' => $fields]);

        $response = $this->client->post($request);

        $this->assertSuccessResponse($response);

        return $response->getData();
    }
1282009
final public function create(array $properties = array())
    {
        $context = $this->getContext();
        $context->entity = $properties;

        if ($this->invokeCommand('before.create', $context) !== false)
        {
            $context->entity = $this->_actionCreate($context);
            $this->invokeCommand('after.create', $context);
        }

        $this->_entity = KObjectConfig::unbox($context->entity);

        return $this->_entity;
    }
284766
public static function create_users_parameters() {
        global $CFG;
        $userfields = [
            'createpassword' => new external_value(PARAM_BOOL, 'True if password should be created and mailed to user.',
                VALUE_OPTIONAL),
            // General.
            'username' => new external_value(core_user::get_property_type('username'),
                'Username policy is defined in Moodle security config.'),
            'auth' => new external_value(core_user::get_property_type('auth'), 'Auth plugins include manual, ldap, etc',
                VALUE_DEFAULT, 'manual', core_user::get_property_null('auth')),
            'password' => new external_value(core_user::get_property_type('password'),
                'Plain text password consisting of any characters', VALUE_OPTIONAL),
            'firstname' => new external_value(core_user::get_property_type('firstname'), 'The first name(s) of the user'),
            'lastname' => new external_value(core_user::get_property_type('lastname'), 'The family name of the user'),
            'email' => new external_value(core_user::get_property_type('email'), 'A valid and unique email address'),
            'maildisplay' => new external_value(core_user::get_property_type('maildisplay'), 'Email display', VALUE_OPTIONAL),
            'city' => new external_value(core_user::get_property_type('city'), 'Home city of the user', VALUE_OPTIONAL),
            'country' => new external_value(core_user::get_property_type('country'),
                'Home country code of the user, such as AU or CZ', VALUE_OPTIONAL),
            'timezone' => new external_value(core_user::get_property_type('timezone'),
                'Timezone code such as Australia/Perth, or 99 for default', VALUE_OPTIONAL),
            'description' => new external_value(core_user::get_property_type('description'), 'User profile description, no HTML',
                VALUE_OPTIONAL),
            // Additional names.
            'firstnamephonetic' => new external_value(core_user::get_property_type('firstnamephonetic'),
                'The first name(s) phonetically of the user', VALUE_OPTIONAL),
            'lastnamephonetic' => new external_value(core_user::get_property_type('lastnamephonetic'),
                'The family name phonetically of the user', VALUE_OPTIONAL),
            'middlename' => new external_value(core_user::get_property_type('middlename'), 'The middle name of the user',
                VALUE_OPTIONAL),
            'alternatename' => new external_value(core_user::get_property_type('alternatename'), 'The alternate name of the user',
                VALUE_OPTIONAL),
            // Interests.
            'interests' => new external_value(PARAM_TEXT, 'User interests (separated by commas)', VALUE_OPTIONAL),
            // Optional.
            'url' => new external_value(core_user::get_property_type('url'), 'User web page', VALUE_OPTIONAL),
            'icq' => new external_value(core_user::get_property_type('icq'), 'ICQ number', VALUE_OPTIONAL),
            'skype' => new external_value(core_user::get_property_type('skype'), 'Skype ID', VALUE_OPTIONAL),
            'aim' => new external_value(core_user::get_property_type('aim'), 'AIM ID', VALUE_OPTIONAL),
            'yahoo' => new external_value(core_user::get_property_type('yahoo'), 'Yahoo ID', VALUE_OPTIONAL),
            'msn' => new external_value(core_user::get_property_type('msn'), 'MSN ID', VALUE_OPTIONAL),
            'idnumber' => new external_value(core_user::get_property_type('idnumber'),
                'An arbitrary ID code number perhaps from the institution', VALUE_DEFAULT, ''),
            'institution' => new external_value(core_user::get_property_type('institution'), 'institution', VALUE_OPTIONAL),
            'department' => new external_value(core_user::get_property_type('department'), 'department', VALUE_OPTIONAL),
            'phone1' => new external_value(core_user::get_property_type('phone1'), 'Phone 1', VALUE_OPTIONAL),
            'phone2' => new external_value(core_user::get_property_type('phone2'), 'Phone 2', VALUE_OPTIONAL),
            'address' => new external_value(core_user::get_property_type('address'), 'Postal address', VALUE_OPTIONAL),
            // Other user preferences stored in the user table.
            'lang' => new external_value(core_user::get_property_type('lang'), 'Language code such as "en", must exist on server',
                VALUE_DEFAULT, core_user::get_property_default('lang'), core_user::get_property_null('lang')),
            'calendartype' => new external_value(core_user::get_property_type('calendartype'),
                'Calendar type such as "gregorian", must exist on server', VALUE_DEFAULT, $CFG->calendartype, VALUE_OPTIONAL),
            'theme' => new external_value(core_user::get_property_type('theme'),
                'Theme name such as "standard", must exist on server', VALUE_OPTIONAL),
            'mailformat' => new external_value(core_user::get_property_type('mailformat'),
                'Mail format code is 0 for plain text, 1 for HTML etc', VALUE_OPTIONAL),
            // Custom user profile fields.
            'customfields' => new external_multiple_structure(
                new external_single_structure(
                    [
                        'type'  => new external_value(PARAM_ALPHANUMEXT, 'The name of the custom field'),
                        'value' => new external_value(PARAM_RAW, 'The value of the custom field')
                    ]
                ), 'User custom fields (also known as user profil fields)', VALUE_OPTIONAL),
            // User preferences.
            'preferences' => new external_multiple_structure(
            new external_single_structure(
                [
                    'type'  => new external_value(PARAM_RAW, 'The name of the preference'),
                    'value' => new external_value(PARAM_RAW, 'The value of the preference')
                ]
            ), 'User preferences', VALUE_OPTIONAL),
        ];
        return new external_function_parameters(
            [
                'users' => new external_multiple_structure(
                    new external_single_structure($userfields)
                )
            ]
        );
    }
996599
public function initFields($extra = array())
    {
        $this->tag = $extra['tag'];
        $this->fields['tag_title'] = new Pluf_Form_Field_Varchar(array(
            'required' => false,
            'label' => __('title')
        ));
        
        $this->fields['tag_description'] = new Pluf_Form_Field_Varchar(array(
            'required' => false,
            'label' => __('description')
        ));
    }
1065488
public static function create_groups_returns() {
        return new external_multiple_structure(
            new external_single_structure(
                array(
                    'id' => new external_value(PARAM_INT, 'group record id'),
                    'courseid' => new external_value(PARAM_INT, 'id of course'),
                    'name' => new external_value(PARAM_TEXT, 'multilang compatible name, course unique'),
                    'description' => new external_value(PARAM_RAW, 'group description text'),
                    'descriptionformat' => new external_format_value('description'),
                    'enrolmentkey' => new external_value(PARAM_RAW, 'group enrol secret phrase'),
                    'idnumber' => new external_value(PARAM_RAW, 'id number')
                )
            ), 'List of group object. A group has an id, a courseid, a name, a description and an enrolment key.'
        );
    }
90652
private static function createWarningFromInvalidValue(array $extra, $key, $default, $additionalMessage = '')
    {
        $warning = sprintf(
            'Invalid value "%s" for option "%s", defaulting to "%s".',
            $extra[$key],
            $key,
            $default
        );

        if ($additionalMessage) {
            $warning .= ' ' . $additionalMessage;
        }

        return $warning;
    }
284112
public function register($additionalParameters = null)
    {
        if ($additionalParameters && !is_object($additionalParameters)) {
            throw new \Exception('additionalParameters must be an object');
        }

        //Ignore registration if disabled setting is set to true
        if (isset($this->settings->disabled) && $this->settings->disabled) {
            return false;
        }

        //Get current global adapter
        $internalAdapter = \Phramework\Database\Database::getAdapter();

        if (!$internalAdapter) {
            throw new \Exception('Global database adapter is not initialized');
        }

        //Create new QueryLogAdapter instance, using current global adapter
        $queryLogAdapter = new QueryLogAdapter(
            $this->settings,
            $internalAdapter,
            $additionalParameters
        );

        //Set newly created QueryLogAdapter instance as global adapter
        \Phramework\Database\Database::setAdapter($queryLogAdapter);

        return true;
    }
811349
public function initFields ($extra = array())
    {
        $this->tenant = $extra['tenant'];
        
        $this->fields['tag_key'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('key')
                ));
        $this->fields['tag_value'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('value')
                ));
        $this->fields['tag_title'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('title')
                ));
        
        $this->fields['tag_description'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('description')
                ));
    }
908806
public function loadContainer(array $additionalConfigsToLoad)
    {
        $configsDir = sprintf('%1$s/..%2$s..%2$s..%2$sResources%2$sconfigs', __DIR__, DIRECTORY_SEPARATOR);
        $container = new ContainerBuilder();

        $loader = new YamlFileLoader($container, new FileLocator($configsDir));
        $loader->load('services.yml');
        $loader->load('parameters.yml');

        foreach ($additionalConfigsToLoad as $config) {
            $additionalLoader = new YamlFileLoader($container, new FileLocator($config->getPath()));
            $additionalLoader->load($config->getPathname());
        }

        $container->compile();

        return $container;
    }
291320
public function getParamsFilters($additionalFields = [])
    {
        if (is_array($additionalFields) && !empty($additionalFields))
        {
            $this->filterParams = array_merge_recursive($this->filterParams, $additionalFields);
        }

        return $this->filterParams;
    }
1170019
public function getUserWithFields(array $fields, IncomingMessage $matchingMessage)
    {
        $messagingDetails = $this->event->get('messaging')[0];
        // implode field array to create concatinated comma string
        $fields = implode(',', $fields);
        // WORKPLACE (Facebook for companies)
        // if community isset in sender Object, it is a request done by workplace
        if (isset($messagingDetails['sender']['community'])) {
            $fields = 'first_name,last_name,email,title,department,employee_number,primary_phone,primary_address,picture,link,locale,name,name_format,updated_time';
        }
        $userInfoData = $this->http->get($this->facebookProfileEndpoint.$matchingMessage->getSender().'?fields='.$fields.'&access_token='.$this->config->get('token'));
        $this->throwExceptionIfResponseNotOk($userInfoData);
        $userInfo = json_decode($userInfoData->getContent(), true);
        $firstName = $userInfo['first_name'] ?? null;
        $lastName = $userInfo['last_name'] ?? null;

        return new User($matchingMessage->getSender(), $firstName, $lastName, null, $userInfo);
    }
878861
public function initFields ($extra = array())
    {
        $this->tenant = $extra['tenant'];
        $this->user = $extra['user'];
        $this->location = $extra['location'];
        if (array_key_exists('vote', $extra)) {
            $this->vote = $extra['vote'];
        }
        $this->vote = Geo_Form_Vote::voteFactory($this->vote);
        
        $this->fields['vote_value'] = new Pluf_Form_Field_Boolean(
                array(
                        'required' => true,
                        'label' => __('vote value'),
                        'initial' => $this->vote->vote_value
                ));
        $this->fields['vote_comment'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('vote comment'),
                        'initial' => $this->vote->vote_comment
                ));
    }
1259736
function _createUser(){
    var excludedFields = ['name', 'screen_name', 'profile_image'],
        nameparts = this.options.user.full_name.split(' '),
        newUser = {
        role: 'external',
        identities: {
            instagram: {
                id: this.options.user.id,
                accessToken: this.options.access_token,
                screen_name: this.options.user.username
            }
        },
        linkedidentities: ['instagram'],
        profile: {
            picture: this.options.user.profile_picture
        },
        enabled: true,
        email: '',
        firstname: nameparts[0],
        displayname: this.options.user.username,
        lastname: (nameparts.length > 1) ? nameparts[1] : ' '
    };

    _.each(profileFieldsArr, function(field){
        if(excludedFields.indexOf(field) === -1){
            newUser.profile[field] = this.socialUserInfo[field];
        }
    }.bind(this));

    return db.users.insert(newUser);
}
314773
public function initFields ($extra = array())
    {
        if (array_key_exists('tag', $extra)) {
            $this->tag = $extra['tag'];
        }
        $this->tag = Geo_Shortcuts_tagFactory($this->tag);
        
        $this->fields['tag_key'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('tag key'),
                        'initial' => $this->tag->tag_key
                ));
        $this->fields['tag_value'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('tag value'),
                        'initial' => $this->tag->tag_value
                ));
        
        $this->fields['description'] = new Pluf_Form_Field_Varchar(
                array(
                        'required' => false,
                        'label' => __('location description'),
                        'initial' => $this->tag->description
                ));
    }