本文整理汇总了PHP中PhoneNumber::populateWithType方法的典型用法代码示例。如果您正苦于以下问题:PHP PhoneNumber::populateWithType方法的具体用法?PHP PhoneNumber::populateWithType怎么用?PHP PhoneNumber::populateWithType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoneNumber
的用法示例。
在下文中一共展示了PhoneNumber::populateWithType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addProcessAction
public function addProcessAction()
{
$dateActiveStart = strtotime($this->_getParam('dateActiveStart'));
$dateActiveEnd = strtotime($this->_getParam('dateActiveEnd'));
$serviceLevel = (int) $this->_getParam('serviceLevel');
$personId = (int) $this->_getParam('personId');
$provider = new Provider();
$provider->person_id = $personId;
$provider->populate();
$provider->serviceLevel = $serviceLevel;
if ($dateActiveStart > 0 && $dateActiveEnd > 0) {
$provider->dateActiveStart = date('Y-m-d H:i:s', $dateActiveStart);
$provider->dateActiveEnd = date('Y-m-d H:i:s', $dateActiveEnd);
}
$person = new Person();
$person->person_id = $personId;
$person->populate();
$address = new Address();
$address->person_id = $personId;
$address->populateWithPersonId($personId);
$phoneNumber = new PhoneNumber();
$phoneNumber->person_id = $personId;
$phoneNumber->populateWithType(4);
$practice = new Practice();
$practice->practiceId = $person->primaryPracticeId;
$practice->populate();
$data = array();
$data['deaNumber'] = $provider->deaNumber;
$data['stateLicenseNumber'] = $provider->stateLicenseNumber;
//$data['portalId'] = Zend_Registry::get('config')->sureScripts->portalId;
//$data['accountId'] = Zend_Registry::get('config')->sureScripts->accountId;
$data['clinicName'] = '' . $practice->name;
$data['lastName'] = $person->last_name;
$data['firstName'] = $person->first_name;
$address = new Address();
$address->personId = $provider->personId;
$address->populateWithType(4);
$data['addressLine1'] = $address->line1;
$data['addressLine2'] = $address->line2;
$data['addressCity'] = $address->city;
$data['addressState'] = $address->state;
$data['addressZipCode'] = $address->zipCode;
$data['email'] = $person->email;
$phoneNumber = new PhoneNumber();
$phoneNumber->personId = $provider->personId;
/*
$phoneNumberIterator = $phoneNumber->getIteratorByPatientId();
$phones = array();
foreach ($phoneNumberIterator as $number) {
if (!strlen($number->number) > 0) continue;
// SS Type options: BN - Beeper, CP - Cellular, FX - Fax, HP - Home, NP - Night, TE – Telephone*, WP – Work
$type = '';
switch ($number->type) {
case PhoneNumber::TYPE_HOME:
$type = 'HP';
case PhoneNumber::TYPE_WORK:
$type = 'WP';
break;
case PhoneNumber::TYPE_MOBILE:
$type = 'CP';
break;
case PhoneNumber::TYPE_FAX:
$type = 'FX';
break;
case PhoneNumber::TYPE_EMERGENCY:
case PhoneNumber::TYPE_EMPLOYER:
case PhoneNumber::TYPE_BILLING:
$type = 'TE';
break;
default:
continue;
}
$phones[$type] = array('number'=>$number->number,'type'=>$type);
}
$te = null;
if (isset($phones['TE'])) {
$te = $phones['TE'];
unset($phones['TE']);
}
$fx = null;
if (isset($phones['FX'])) {
$fx = $phones['FX'];
unset($phones['FX']);
}
if ($te === null) {
if (count($phones) > 0) {
$te = array_unshift($phones);
}
else if ($fx !== null) {
$te = $fx;
}
}
if ($fx === null) {
if (count($phones) > 0) {
$fx = array_unshift($phones);
}
else if ($te !== null) {
$fx = $te;
}
}
//.........这里部分代码省略.........