本文整理汇总了PHP中UserFactory::setWorkEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP UserFactory::setWorkEmail方法的具体用法?PHP UserFactory::setWorkEmail怎么用?PHP UserFactory::setWorkEmail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserFactory
的用法示例。
在下文中一共展示了UserFactory::setWorkEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserDefaultListFactory
$udlf = new UserDefaultListFactory();
$udlf->getByCompanyId($mapped_row['company_id']);
if ($udlf->getRecordCount() > 0) {
Debug::Text('Using User Defaults', __FILE__, __LINE__, __METHOD__, 10);
$udf_obj = $udlf->getCurrent();
$uf->setTitle($udf_obj->getTitle());
$uf->setCity($udf_obj->getCity());
if ($udf_obj->getProvince() != '' and $udf_obj->getProvince() != 0) {
$uf->setProvince($udf_obj->getProvince());
}
if ($udf_obj->getCountry() != '') {
$uf->setCountry($udf_obj->getCountry());
}
$uf->setWorkPhone($udf_obj->getWorkPhone());
$uf->setWorkPhoneExt($udf_obj->getWorkPhoneExt());
$uf->setWorkEmail($udf_obj->getWorkEmail());
$uf->setHireDate($udf_obj->getHireDate());
$uf->setDefaultBranch($udf_obj->getDefaultBranch());
$uf->setDefaultDepartment($udf_obj->getDefaultDepartment());
if ($udf_obj->getPermissionControl() != '') {
$uf->setPermissionControl($udf_obj->getPermissionControl());
}
if ($udf_obj->getPayPeriodSchedule() != '') {
$uf->setPayPeriodSchedule($udf_obj->getPayPeriodSchedule());
}
if ($udf_obj->getPolicyGroup() != '') {
$uf->setPolicyGroup($udf_obj->getPolicyGroup());
}
if ($udf_obj->getCurrency() != '') {
$uf->setCurrency($udf_obj->getCurrency());
}
示例2: 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);
//.........这里部分代码省略.........
示例3: PermissionControlListFactory
case 'next':
//Debug::setVerbosity(11);
Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
$uf->StartTransaction();
$uf->setCompany($user_data['company_id']);
$uf->setStatus(10);
$uf->setUserName($user_data['user_name']);
if (!empty($user_data['password']) and $user_data['password'] == $user_data['password2']) {
$uf->setPassword($user_data['password']);
} else {
$uf->Validator->isTrue($uf->password_validator_label, FALSE, $uf->password_validator_match_msg);
}
$uf->setEmployeeNumber(1);
$uf->setFirstName($user_data['first_name']);
$uf->setLastName($user_data['last_name']);
$uf->setWorkEmail($user_data['work_email']);
//Get Permission Control with highest ID, assume its for Administrators
//and use it.
$pclf = new PermissionControlListFactory();
$pclf->getByCompanyId($user_data['company_id'], NULL, NULL, NULL, array('id' => 'desc'));
if ($pclf->getRecordCount() > 0) {
$pc_obj = $pclf->getCurrent();
if (is_object($pc_obj)) {
Debug::Text('Adding User to Permission Control: ' . $pc_obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
$uf->setPermissionControl($pc_obj->getId());
}
}
if ($uf->isValid()) {
$user_id = $uf->Save();
$uf->CommitTransaction();
if ($external_installer == 1) {