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


PHP UserFactory::setBirthDate方法代碼示例

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


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

示例1: createUser

 function createUser($company_id, $type, $policy_group_id = 0, $default_branch_id = 0, $default_department_id = 0, $default_currency_id = 0, $user_group_id = 0)
 {
     $uf = new UserFactory();
     $uf->setCompany($company_id);
     $uf->setStatus(10);
     //$uf->setPolicyGroup( 0 );
     if ($default_currency_id == 0) {
         Debug::Text('Get Default Currency...', __FILE__, __LINE__, __METHOD__, 10);
         //Get Default.
         $crlf = new CurrencyListFactory();
         $crlf->getByCompanyIdAndDefault($company_id, TRUE);
         if ($crlf->getRecordCount() > 0) {
             $default_currency_id = $crlf->getCurrent()->getId();
             Debug::Text('Default Currency ID: ' . $default_currency_id, __FILE__, __LINE__, __METHOD__, 10);
         }
     }
     $hire_date = strtotime(rand(2000, 2005) . '-' . rand(1, 12) . '-' . rand(1, 28));
     switch ($type) {
         case 10:
             //John Doe
             $uf->setUserName('john.doe' . $this->getUserNamePostfix());
             $uf->setPassword('demo');
             //$uf->setPhoneId( '1111' );
             //$uf->setPhonePassword( '1111' );
             $uf->setFirstName('John');
             $uf->setLastName('Doe');
             $uf->setSex(10);
             $uf->setAddress1(rand(100, 9999) . ' Springfield St');
             $uf->setAddress2('Unit #' . rand(10, 999));
             $uf->setCity('New York');
             $uf->setCountry('US');
             $uf->setProvince('NY');
             $uf->setPostalCode(str_pad(rand(400, 599), 5, 0, STR_PAD_LEFT));
             $uf->setWorkPhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkPhoneExt(rand(100, 1000));
             $uf->setHomePhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkEmail($uf->getUserName() . '@abc-company.com');
             $uf->setSIN(rand(100, 999) . '-' . rand(100, 999) . '-' . rand(100, 999));
             $uf->setBirthDate(strtotime(rand(1970, 1990) . '-' . rand(1, 12) . '-' . rand(1, 28)));
             $uf->setHireDate($hire_date);
             $uf->setEmployeeNumber($type);
             $uf->setDefaultBranch($default_branch_id);
             $uf->setDefaultDepartment($default_department_id);
             $uf->setCurrency($default_currency_id);
             $uf->setGroup($user_group_id);
             break;
         case 11:
             //Theodora  Simmons
             $uf->setUserName('theodora.simmons' . $this->getUserNamePostfix());
             $uf->setPassword('demo');
             //$uf->setPhoneId( '1111' );
             //$uf->setPhonePassword( '1111' );
             $uf->setFirstName('Theodora');
             $uf->setLastName('Simmons');
             $uf->setSex(10);
             $uf->setAddress1(rand(100, 9999) . ' Springfield St');
             $uf->setAddress2('Unit #' . rand(10, 999));
             $uf->setCity('New York');
             $uf->setCountry('US');
             $uf->setProvince('NY');
             $uf->setPostalCode(str_pad(rand(400, 599), 5, 0, STR_PAD_LEFT));
             $uf->setWorkPhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkPhoneExt(rand(100, 1000));
             $uf->setHomePhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkEmail($uf->getUserName() . '@abc-company.com');
             $uf->setSIN(rand(100, 999) . '-' . rand(100, 999) . '-' . rand(100, 999));
             $uf->setBirthDate(strtotime(rand(1970, 1990) . '-' . rand(1, 12) . '-' . rand(1, 28)));
             $uf->setHireDate($hire_date);
             $uf->setEmployeeNumber($type);
             $uf->setDefaultBranch($default_branch_id);
             $uf->setDefaultDepartment($default_department_id);
             $uf->setCurrency($default_currency_id);
             $uf->setGroup($user_group_id);
             break;
         case 12:
             //Kitty  Nicholas
             $uf->setUserName('kitty.nicholas' . $this->getUserNamePostfix());
             $uf->setPassword('demo');
             //$uf->setPhoneId( '1111' );
             //$uf->setPhonePassword( '1111' );
             $uf->setFirstName('Kitty');
             $uf->setLastName('Nicholas');
             $uf->setSex(20);
             $uf->setAddress1(rand(100, 9999) . ' Ethel St');
             $uf->setAddress2('Unit #' . rand(10, 999));
             $uf->setCity('New York');
             $uf->setCountry('US');
             $uf->setProvince('NY');
             $uf->setPostalCode(str_pad(rand(400, 599), 5, 0, STR_PAD_LEFT));
             $uf->setWorkPhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkPhoneExt(rand(100, 1000));
             $uf->setHomePhone(rand(403, 600) . '-' . rand(250, 600) . '-' . rand(1000, 9999));
             $uf->setWorkEmail($uf->getUserName() . '@abc-company.com');
             $uf->setSIN(rand(100, 999) . '-' . rand(100, 999) . '-' . rand(100, 999));
             $uf->setBirthDate(strtotime(rand(1970, 1990) . '-' . rand(1, 12) . '-' . rand(1, 28)));
             $uf->setHireDate($hire_date);
             $uf->setEmployeeNumber($type);
             $uf->setDefaultBranch($default_branch_id);
             $uf->setDefaultDepartment($default_department_id);
             $uf->setCurrency($default_currency_id);
//.........這裏部分代碼省略.........
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:101,代碼來源:DemoData.class.php


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