本文整理匯總了PHP中XLite\View\AView::getAddressSectionData方法的典型用法代碼示例。如果您正苦於以下問題:PHP AView::getAddressSectionData方法的具體用法?PHP AView::getAddressSectionData怎麽用?PHP AView::getAddressSectionData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XLite\View\AView
的用法示例。
在下文中一共展示了AView::getAddressSectionData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAddressSectionData
/**
* Return specific data for address entry. Helper.
*
* @param \XLite\Model\Address $address Address
* @param boolean $showEmpty Show empty fields OPTIONAL
*
* @return array
*/
protected function getAddressSectionData(\XLite\Model\Address $address, $showEmpty = false)
{
$data = parent::getAddressSectionData($address, $showEmpty);
$result = array();
$name = array('title' => isset($data['title']) ? $data['title'] : null, 'firstname' => isset($data['firstname']) ? $data['firstname'] : null, 'lastname' => isset($data['lastname']) ? $data['lastname'] : null);
foreach ($data as $serviceName => $field) {
switch ($serviceName) {
case 'title':
case 'firstname':
case 'lastname':
$result += array_filter($name);
unset($data['title']);
unset($data['firstname']);
unset($data['lastname']);
break;
default:
$result[$serviceName] = $field;
break;
}
}
return $result;
}