Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Region.php
Go to the documentation of this file.
1 <?php
8 
24 {
28  protected function _construct()
29  {
30  $this->_init(\Magento\Directory\Model\ResourceModel\Region::class);
31  }
32 
40  public function getName()
41  {
42  $name = $this->getData('name');
43  if ($name === null) {
44  $name = $this->getData('default_name');
45  }
46  return $name;
47  }
48 
56  public function loadByCode($code, $countryId)
57  {
58  if ($code) {
59  $this->_getResource()->loadByCode($this, $code, $countryId);
60  }
61  return $this;
62  }
63 
71  public function loadByName($name, $countryId)
72  {
73  $this->_getResource()->loadByName($this, $name, $countryId);
74  return $this;
75  }
76 }
loadByCode($code, $countryId)
Definition: Region.php:56
getData($key='', $index=null)
Definition: DataObject.php:119
loadByName($name, $countryId)
Definition: Region.php:71
$code
Definition: info.phtml:12
if(!isset($_GET['name'])) $name
Definition: log.php:14