當前位置: 首頁>>代碼示例>>PHP>>正文


PHP core_user::get_property_null方法代碼示例

本文整理匯總了PHP中core_user::get_property_null方法的典型用法代碼示例。如果您正苦於以下問題:PHP core_user::get_property_null方法的具體用法?PHP core_user::get_property_null怎麽用?PHP core_user::get_property_null使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core_user的用法示例。


在下文中一共展示了core_user::get_property_null方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create_users_parameters

 /**
  * Returns description of method parameters
  *
  * @return external_function_parameters
  * @since Moodle 2.2
  */
 public static function create_users_parameters()
 {
     global $CFG;
     return new external_function_parameters(array('users' => new external_multiple_structure(new external_single_structure(array('username' => new external_value(core_user::get_property_type('username'), 'Username policy is defined in Moodle security config.'), 'password' => new external_value(core_user::get_property_type('password'), 'Plain text password consisting of any characters', VALUE_OPTIONAL), 'createpassword' => new external_value(PARAM_BOOL, 'True if password should be created and mailed to user.', 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'), 'auth' => new external_value(core_user::get_property_type('auth'), 'Auth plugins include manual, ldap, imap, etc', VALUE_DEFAULT, 'manual', core_user::get_property_null('auth')), 'idnumber' => new external_value(core_user::get_property_type('idnumber'), 'An arbitrary ID code number perhaps from the institution', VALUE_DEFAULT, ''), '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), '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, no HTML', 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), '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), 'preferences' => new external_multiple_structure(new external_single_structure(array('type' => new external_value(PARAM_ALPHANUMEXT, 'The name of the preference'), 'value' => new external_value(PARAM_RAW, 'The value of the preference'))), 'User preferences', VALUE_OPTIONAL), 'customfields' => new external_multiple_structure(new external_single_structure(array('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))))));
 }
開發者ID:sirromas,項目名稱:lms,代碼行數:11,代碼來源:externallib.php

示例2: test_get_property_choices

 /**
  * Test get_property_choices() method.
  */
 public function test_get_property_choices()
 {
     // Test against country property choices.
     $choices = core_user::get_property_choices('country');
     $this->assertArrayHasKey('AU', $choices);
     $this->assertArrayHasKey('BR', $choices);
     $this->assertArrayNotHasKey('WW', $choices);
     $this->assertArrayNotHasKey('TX', $choices);
     // Test against lang property choices.
     $choices = core_user::get_property_choices('lang');
     $this->assertArrayHasKey('en', $choices);
     $this->assertArrayNotHasKey('ww', $choices);
     $this->assertArrayNotHasKey('yy', $choices);
     // Test against theme property choices.
     $choices = core_user::get_property_choices('theme');
     $this->assertArrayHasKey('base', $choices);
     $this->assertArrayHasKey('clean', $choices);
     $this->assertArrayNotHasKey('unknowntheme', $choices);
     $this->assertArrayNotHasKey('wrongtheme', $choices);
     // Try to fetch type of a non-existent properties.
     $nonexistingproperty = 'language';
     $this->expectException('coding_exception');
     $this->expectExceptionMessage('Invalid property requested: ' . $nonexistingproperty);
     core_user::get_property_null($nonexistingproperty);
     $nonexistingproperty = 'coutries';
     $this->expectExceptionMessage('Invalid property requested: ' . $nonexistingproperty);
     core_user::get_property_null($nonexistingproperty);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:31,代碼來源:user_test.php

示例3: test_get_property_choices

 /**
  * Test get_property_choices() method.
  */
 public function test_get_property_choices()
 {
     // Test against country property choices.
     $choices = core_user::get_property_choices('country');
     $this->assertArrayHasKey('AU', $choices);
     $this->assertArrayHasKey('BR', $choices);
     $this->assertArrayNotHasKey('WW', $choices);
     $this->assertArrayNotHasKey('TX', $choices);
     // Test against lang property choices.
     $choices = core_user::get_property_choices('lang');
     $this->assertArrayHasKey('en', $choices);
     $this->assertArrayNotHasKey('ww', $choices);
     $this->assertArrayNotHasKey('yy', $choices);
     // Test against theme property choices.
     $choices = core_user::get_property_choices('theme');
     $this->assertArrayHasKey('base', $choices);
     $this->assertArrayHasKey('clean', $choices);
     $this->assertArrayNotHasKey('unknowntheme', $choices);
     $this->assertArrayNotHasKey('wrongtheme', $choices);
     // Test against timezone property choices.
     $choices = core_user::get_property_choices('timezone');
     $this->assertArrayHasKey('America/Sao_Paulo', $choices);
     $this->assertArrayHasKey('Australia/Perth', $choices);
     $this->assertArrayHasKey('99', $choices);
     $this->assertArrayHasKey('UTC', $choices);
     $this->assertArrayNotHasKey('North Korea', $choices);
     $this->assertArrayNotHasKey('New york', $choices);
     // Try to fetch type of a non-existent properties.
     $nonexistingproperty = 'language';
     $this->setExpectedException('coding_exception', 'Invalid property requested: ' . $nonexistingproperty);
     core_user::get_property_null($nonexistingproperty);
     $nonexistingproperty = 'coutries';
     $this->setExpectedException('coding_exception', 'Invalid property requested: ' . $nonexistingproperty);
     core_user::get_property_null($nonexistingproperty);
 }
開發者ID:reconnectmedia,項目名稱:moodle,代碼行數:38,代碼來源:user_test.php


注:本文中的core_user::get_property_null方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。