54 \
Magento\Framework\Locale\ListsInterface $localeLists,
58 \
Magento\Framework\Data\Collection\AbstractDb $resourceCollection =
null,
62 $this->_localeLists = $localeLists;
63 $this->_formatFactory = $formatFactory;
64 $this->_regionCollectionFactory = $regionCollectionFactory;
112 $collection = $this->_regionCollectionFactory->create();
128 $template = $this->
getData(
'address_template_' . ($html ?
'html' :
'plain'));
130 if (!$this->
getId()) {
131 $template =
'{{firstname}} {{lastname}}';
137 {{city}}, {{region}} {{postcode}}";
139 $template =
"{{firstname}} {{lastname}}<br/> 141 {{city}}, {{region}} {{postcode}}<br/> 146 $filter = new \Magento\Framework\Filter\Template\Simple();
150 $addressText = preg_replace(
'#(<br\s*/?>\s*){2,}#im',
'<br/>', $addressText);
152 $addressText = preg_replace(
'#(\n\s*){2,}#m',
"\n", $addressText);
165 if (!isset(self::$_format[$this->
getId()]) && $this->
getId()) {
166 self::$_format[$this->
getId()] = $this->_formatFactory->create()->getCollection()->setCountryFilter(
171 if (isset(self::$_format[$this->
getId()])) {
172 return self::$_format[$this->
getId()];
203 if ($locale ==
null) {
204 $cache_key =
'name_default';
206 $cache_key =
'name_' . $locale;
209 if (!$this->
getData($cache_key)) {
210 $this->
setData($cache_key, $this->_localeLists->getCountryTranslation($this->getId(), $locale));
212 return $this->
getData($cache_key);
setData($key, $value=null)
getData($key='', $index=null)
elseif(isset( $params[ 'redirect_parent']))
getLoadedRegionCollection()
formatAddress(\Magento\Framework\DataObject $address, $html=false)
$_regionCollectionFactory
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Locale\ListsInterface $localeLists, \Magento\Directory\Model\Country\FormatFactory $formatFactory, \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])