Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Address Class Reference
Inheritance diagram for Address:
AbstractModel OrderAddressInterface AddressModelInterface AbstractExtensibleModel ExtensibleDataInterface AbstractModel CustomAttributesDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 setOrder (\Magento\Sales\Model\Order $order)
 
 getRegionCode ()
 
 getName ()
 
 setData ($key, $value=null)
 
 explodeStreetAddress ()
 
 getOrder ()
 
 getStreet ()
 
 getStreetLine ($number)
 
 getAddressType ()
 
 getCity ()
 
 getCompany ()
 
 getCountryId ()
 
 getCustomerAddressId ()
 
 getCustomerId ()
 
 getEmail ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 getFax ()
 
 getFirstname ()
 
 getLastname ()
 
 getMiddlename ()
 
 getParentId ()
 
 getPostcode ()
 
 getPrefix ()
 
 getRegion ()
 
 getRegionId ()
 
 getSuffix ()
 
 getTelephone ()
 
 getVatId ()
 
 getVatIsValid ()
 
 getVatRequestDate ()
 
 getVatRequestId ()
 
 getVatRequestSuccess ()
 
 setParentId ($id)
 
 setCustomerAddressId ($id)
 
 setRegionId ($id)
 
 setStreet ($street)
 
 setCustomerId ($id)
 
 setFax ($fax)
 
 setRegion ($region)
 
 setPostcode ($postcode)
 
 setLastname ($lastname)
 
 setCity ($city)
 
 setEmail ($email)
 
 setTelephone ($telephone)
 
 setCountryId ($id)
 
 setFirstname ($firstname)
 
 setAddressType ($addressType)
 
 setPrefix ($prefix)
 
 setMiddlename ($middlename)
 
 setSuffix ($suffix)
 
 setCompany ($company)
 
 setVatId ($id)
 
 setVatIsValid ($vatIsValid)
 
 setVatRequestId ($id)
 
 setRegionCode ($regionCode)
 
 setVatRequestDate ($vatRequestDate)
 
 setVatRequestSuccess ($vatRequestSuccess)
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Sales\Api\Data\OrderAddressExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getEventObject ()
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from OrderAddressInterface
 setExtensionAttributes (\Magento\Sales\Api\Data\OrderAddressExtensionInterface $extensionAttributes)
 

Data Fields

const TYPE_BILLING = 'billing'
 
const TYPE_SHIPPING = 'shipping'
 
- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from OrderAddressInterface
const ENTITY_ID = 'entity_id'
 
const PARENT_ID = 'parent_id'
 
const CUSTOMER_ADDRESS_ID = 'customer_address_id'
 
const REGION_ID = 'region_id'
 
const KEY_REGION_CODE = 'region_code'
 
const CUSTOMER_ID = 'customer_id'
 
const FAX = 'fax'
 
const REGION = 'region'
 
const POSTCODE = 'postcode'
 
const LASTNAME = 'lastname'
 
const STREET = 'street'
 
const CITY = 'city'
 
const EMAIL = 'email'
 
const TELEPHONE = 'telephone'
 
const COUNTRY_ID = 'country_id'
 
const FIRSTNAME = 'firstname'
 
const ADDRESS_TYPE = 'address_type'
 
const PREFIX = 'prefix'
 
const MIDDLENAME = 'middlename'
 
const SUFFIX = 'suffix'
 
const COMPANY = 'company'
 
const VAT_ID = 'vat_id'
 
const VAT_IS_VALID = 'vat_is_valid'
 
const VAT_REQUEST_ID = 'vat_request_id'
 
const VAT_REQUEST_DATE = 'vat_request_date'
 
const VAT_REQUEST_SUCCESS = 'vat_request_success'
 

Protected Member Functions

 _construct ()
 
 implodeStreetValue ($value)
 
 implodeStreetField (array $data)
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $order
 
 $_eventPrefix = 'sales_order_address'
 
 $_eventObject = 'address'
 
 $orderFactory
 
 $regionFactory
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Sales order address model

@api @method \Magento\Customer\Api\Data\AddressInterface getCustomerAddressData() @method Address setCustomerAddressData(\Magento\Customer\Api\Data\AddressInterface $value) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.ExcessivePublicCount)

Since
100.0.2

Definition at line 22 of file Address.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Model\Context  $context,
\Magento\Framework\Registry  $registry,
\Magento\Framework\Api\ExtensionAttributesFactory  $extensionFactory,
\Magento\Framework\Api\AttributeValueFactory  $customAttributeFactory,
\Magento\Sales\Model\OrderFactory  $orderFactory,
\Magento\Directory\Model\RegionFactory  $regionFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource  $resource = null,
\Magento\Framework\Data\Collection\AbstractDb  $resourceCollection = null,
array  $data = [] 
)
Parameters
\Magento\Framework\Model\Context$context
\Magento\Framework\Registry$registry
\Magento\Framework\Api\ExtensionAttributesFactory$extensionFactory
\Magento\Framework\Api\AttributeValueFactory$customAttributeFactory
\Magento\Sales\Model\OrderFactory$orderFactory
\Magento\Directory\Model\RegionFactory$regionFactory
\Magento\Framework\Model\ResourceModel\AbstractResource$resource
\Magento\Framework\Data\Collection\AbstractDb$resourceCollection
array$data

Definition at line 67 of file Address.php.

77  {
78  $data = $this->implodeStreetField($data);
79  $this->regionFactory = $regionFactory;
80  $this->orderFactory = $orderFactory;
81  parent::__construct(
82  $context,
83  $registry,
84  $extensionFactory,
86  $resource,
87  $resourceCollection,
88  $data
89  );
90  }
$resource
Definition: bulk.php:12

Member Function Documentation

◆ _construct()

_construct ( )
protected

Initialize resource

Returns
void

Definition at line 97 of file Address.php.

98  {
99  $this->_init(\Magento\Sales\Model\ResourceModel\Order\Address::class);
100  }

◆ explodeStreetAddress()

explodeStreetAddress ( )

Create fields street1, street2, etc.

To be used in controllers for views data

Returns
$this

Implements AddressModelInterface.

Definition at line 210 of file Address.php.

211  {
212  $streetLines = $this->getStreet();
213  foreach ($streetLines as $lineNumber => $lineValue) {
214  $this->setData(OrderAddressInterface::STREET . ($lineNumber + 1), $lineValue);
215  }
216  return $this;
217  }
setData($key, $value=null)
Definition: Address.php:179

◆ getAddressType()

getAddressType ( )

Returns address_type

Returns
string

Implements OrderAddressInterface.

Definition at line 264 of file Address.php.

◆ getCity()

getCity ( )

Returns city

Returns
string

Implements OrderAddressInterface.

Definition at line 274 of file Address.php.

◆ getCompany()

getCompany ( )

Returns company

Returns
string

Implements OrderAddressInterface.

Definition at line 284 of file Address.php.

◆ getCountryId()

getCountryId ( )

Returns country_id

Returns
string

Implements OrderAddressInterface.

Definition at line 294 of file Address.php.

◆ getCustomerAddressId()

getCustomerAddressId ( )

Returns customer_address_id

Returns
int

Implements OrderAddressInterface.

Definition at line 304 of file Address.php.

◆ getCustomerId()

getCustomerId ( )

Returns customer_id

Returns
int

Implements OrderAddressInterface.

Definition at line 314 of file Address.php.

◆ getEmail()

getEmail ( )

Returns email

Returns
string

Implements OrderAddressInterface.

Definition at line 324 of file Address.php.

◆ getEntityId()

getEntityId ( )

Returns entity_id

Returns
int

Implements OrderAddressInterface.

Definition at line 334 of file Address.php.

◆ getExtensionAttributes()

getExtensionAttributes ( )

{Retrieve existing extension attributes object or create a new one.

Returns
\Magento\Sales\Api\Data\OrderAddressExtensionInterface|null
}

Returns
\Magento\Sales\Api\Data\OrderAddressExtensionInterface|null

Implements OrderAddressInterface.

Definition at line 715 of file Address.php.

◆ getFax()

getFax ( )

Returns fax

Returns
string

Implements OrderAddressInterface.

Definition at line 355 of file Address.php.

◆ getFirstname()

getFirstname ( )

Returns firstname

Returns
string

Implements OrderAddressInterface.

Definition at line 365 of file Address.php.

◆ getLastname()

getLastname ( )

Returns lastname

Returns
string

Implements OrderAddressInterface.

Definition at line 375 of file Address.php.

◆ getMiddlename()

getMiddlename ( )

Returns middlename

Returns
string

Implements OrderAddressInterface.

Definition at line 385 of file Address.php.

◆ getName()

getName ( )

Get full customer name

Returns
string

Definition at line 141 of file Address.php.

142  {
143  $name = '';
144  if ($this->getPrefix()) {
145  $name .= $this->getPrefix() . ' ';
146  }
147  $name .= $this->getFirstname();
148  if ($this->getMiddlename()) {
149  $name .= ' ' . $this->getMiddlename();
150  }
151  $name .= ' ' . $this->getLastname();
152  if ($this->getSuffix()) {
153  $name .= ' ' . $this->getSuffix();
154  }
155  return $name;
156  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ getOrder()

getOrder ( )

Get order

Returns
\Magento\Sales\Model\Order

Definition at line 224 of file Address.php.

225  {
226  if (!$this->order) {
227  $this->order = $this->orderFactory->create()->load($this->getParentId());
228  }
229  return $this->order;
230  }

◆ getParentId()

getParentId ( )

Returns parent_id

Returns
int

Implements OrderAddressInterface.

Definition at line 395 of file Address.php.

◆ getPostcode()

getPostcode ( )

Returns postcode

Returns
string

Implements OrderAddressInterface.

Definition at line 405 of file Address.php.

◆ getPrefix()

getPrefix ( )

Returns prefix

Returns
string

Implements OrderAddressInterface.

Definition at line 415 of file Address.php.

◆ getRegion()

getRegion ( )

Returns region

Returns
string

Implements OrderAddressInterface.

Definition at line 425 of file Address.php.

◆ getRegionCode()

getRegionCode ( )

Return 2 letter state code if available, otherwise full region name

Returns
null|string

Implements OrderAddressInterface.

Definition at line 121 of file Address.php.

122  {
123  $regionId = (!$this->getRegionId() && is_numeric($this->getRegion())) ?
124  $this->getRegion() :
125  $this->getRegionId();
126  $model = $this->regionFactory->create()->load($regionId);
127  if ($model->getCountryId() == $this->getCountryId()) {
128  return $model->getCode();
129  } elseif (is_string($this->getRegion())) {
130  return $this->getRegion();
131  } else {
132  return null;
133  }
134  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

◆ getRegionId()

getRegionId ( )

Returns region_id

Returns
int

Implements OrderAddressInterface.

Definition at line 435 of file Address.php.

◆ getStreet()

getStreet ( )

Retrieve street field of an address

Returns
string[]

Implements OrderAddressInterface.

Definition at line 237 of file Address.php.

238  {
239  if (is_array($this->getData(OrderAddressInterface::STREET))) {
240  return $this->getData(OrderAddressInterface::STREET);
241  }
242  return explode(PHP_EOL, $this->getData(OrderAddressInterface::STREET));
243  }

◆ getStreetLine()

getStreetLine (   $number)

Get street line by number

Parameters
int$number
Returns
string

Implements AddressModelInterface.

Definition at line 251 of file Address.php.

252  {
253  $lines = $this->getStreet();
254  return isset($lines[$number - 1]) ? $lines[$number - 1] : '';
255  }
$number
Definition: details.phtml:22

◆ getSuffix()

getSuffix ( )

Returns suffix

Returns
string

Implements OrderAddressInterface.

Definition at line 445 of file Address.php.

◆ getTelephone()

getTelephone ( )

Returns telephone

Returns
string

Implements OrderAddressInterface.

Definition at line 455 of file Address.php.

◆ getVatId()

getVatId ( )

Returns vat_id

Returns
string

Implements OrderAddressInterface.

Definition at line 465 of file Address.php.

◆ getVatIsValid()

getVatIsValid ( )

Returns vat_is_valid

Returns
int

Implements OrderAddressInterface.

Definition at line 475 of file Address.php.

◆ getVatRequestDate()

getVatRequestDate ( )

Returns vat_request_date

Returns
string

Implements OrderAddressInterface.

Definition at line 485 of file Address.php.

◆ getVatRequestId()

getVatRequestId ( )

Returns vat_request_id

Returns
string

Implements OrderAddressInterface.

Definition at line 495 of file Address.php.

◆ getVatRequestSuccess()

getVatRequestSuccess ( )

Returns vat_request_success

Returns
int

Implements OrderAddressInterface.

Definition at line 505 of file Address.php.

◆ implodeStreetField()

implodeStreetField ( array  $data)
protected

Implode value of the street field, if it is present among other fields

Parameters
array$data
Returns
array

Definition at line 195 of file Address.php.

◆ implodeStreetValue()

implodeStreetValue (   $value)
protected

Combine values of street lines into a single string

Parameters
string[]|string$value
Returns
string

Definition at line 164 of file Address.php.

165  {
166  if (is_array($value)) {
167  $value = trim(implode(PHP_EOL, $value));
168  }
169  return $value;
170  }
$value
Definition: gender.phtml:16

◆ setAddressType()

setAddressType (   $addressType)

{Sets the address type for the order address.

Parameters
string$addressType
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 625 of file Address.php.

626  {
627  return $this->setData(OrderAddressInterface::ADDRESS_TYPE, $addressType);
628  }
setData($key, $value=null)
Definition: Address.php:179

◆ setCity()

setCity (   $city)

{Sets the city for the order address.

Parameters
string$city
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 585 of file Address.php.

◆ setCompany()

setCompany (   $company)

{Sets the company for the order address.

Parameters
string$company
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 657 of file Address.php.

◆ setCountryId()

setCountryId (   $id)

{Sets the country ID for the order address.

Parameters
string$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 609 of file Address.php.

◆ setCustomerAddressId()

setCustomerAddressId (   $id)

{Sets the country address ID for the order address.

Parameters
int$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 521 of file Address.php.

◆ setCustomerId()

setCustomerId (   $id)

{Sets the customer ID for the order address.

Parameters
int$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 545 of file Address.php.

◆ setData()

setData (   $key,
  $value = null 
)

Enforce format of the street field

Parameters
array | string$key
null$value
Returns
\Magento\Framework\DataObject

Definition at line 179 of file Address.php.

180  {
181  if (is_array($key)) {
182  $key = $this->implodeStreetField($key);
184  $value = $this->implodeStreetValue($value);
185  }
186  return parent::setData($key, $value);
187  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$value
Definition: gender.phtml:16

◆ setEmail()

setEmail (   $email)

{Sets the email address for the order address.

Parameters
string$email
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 593 of file Address.php.

◆ setEntityId()

setEntityId (   $entityId)

Sets the ID for the order address.

Parameters
int$entityId
Returns
$this

Implements OrderAddressInterface.

Definition at line 345 of file Address.php.

346  {
347  return $this->setData(OrderAddressInterface::ENTITY_ID, $entityId);
348  }
setData($key, $value=null)
Definition: Address.php:179

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Sales\Api\Data\OrderAddressExtensionInterface  $extensionAttributes)

{}

Parameters
\Magento\Sales\Api\Data\OrderAddressExtensionInterface$extensionAttributes
Returns
$this

Definition at line 726 of file Address.php.

727  {
729  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setFax()

setFax (   $fax)

{Sets the fax number for the order address.

Parameters
string$fax
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 553 of file Address.php.

◆ setFirstname()

setFirstname (   $firstname)

{Sets the first name for the order address.

Parameters
string$firstname
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 617 of file Address.php.

618  {
619  return $this->setData(OrderAddressInterface::FIRSTNAME, $firstname);
620  }
setData($key, $value=null)
Definition: Address.php:179

◆ setLastname()

setLastname (   $lastname)

{Sets the last name for the order address.

Parameters
string$lastname
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 577 of file Address.php.

578  {
579  return $this->setData(OrderAddressInterface::LASTNAME, $lastname);
580  }
setData($key, $value=null)
Definition: Address.php:179

◆ setMiddlename()

setMiddlename (   $middlename)

{Sets the middle name for the order address.

Parameters
string$middlename
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 641 of file Address.php.

642  {
643  return $this->setData(OrderAddressInterface::MIDDLENAME, $middlename);
644  }
setData($key, $value=null)
Definition: Address.php:179

◆ setOrder()

setOrder ( \Magento\Sales\Model\Order  $order)

Set order

@codeCoverageIgnore

Parameters
\Magento\Sales\Model\Order$order
Returns
$this

Definition at line 110 of file Address.php.

111  {
112  $this->order = $order;
113  return $this;
114  }

◆ setParentId()

setParentId (   $id)

{Sets the parent ID for the order address.

Parameters
int$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 513 of file Address.php.

◆ setPostcode()

setPostcode (   $postcode)

{Sets the postal code for the order address.

Parameters
string$postcode
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 569 of file Address.php.

570  {
571  return $this->setData(OrderAddressInterface::POSTCODE, $postcode);
572  }
setData($key, $value=null)
Definition: Address.php:179

◆ setPrefix()

setPrefix (   $prefix)

{Sets the prefix for the order address.

Parameters
string$prefix
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 633 of file Address.php.

◆ setRegion()

setRegion (   $region)

{Sets the region for the order address.

Parameters
string$region
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 561 of file Address.php.

◆ setRegionCode()

setRegionCode (   $regionCode)

{Set region code

Parameters
string$regionCode
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 689 of file Address.php.

690  {
691  return $this->setData(OrderAddressInterface::KEY_REGION_CODE, $regionCode);
692  }
setData($key, $value=null)
Definition: Address.php:179

◆ setRegionId()

setRegionId (   $id)

{Sets the region ID for the order address.

Parameters
int$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 529 of file Address.php.

◆ setStreet()

setStreet (   $street)

{Sets the street values, if any, for the order address.

Parameters
string|string[]$street
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 537 of file Address.php.

◆ setSuffix()

setSuffix (   $suffix)

{Sets the suffix for the order address.

Parameters
string$suffix
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 649 of file Address.php.

◆ setTelephone()

setTelephone (   $telephone)

{Sets the telephone number for the order address.

Parameters
string$telephone
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 601 of file Address.php.

602  {
603  return $this->setData(OrderAddressInterface::TELEPHONE, $telephone);
604  }
setData($key, $value=null)
Definition: Address.php:179

◆ setVatId()

setVatId (   $id)

{Sets the VAT ID for the order address.

Parameters
string$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 665 of file Address.php.

◆ setVatIsValid()

setVatIsValid (   $vatIsValid)

{Sets the VAT-is-valid flag value for the order address.

Parameters
int$vatIsValid
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 673 of file Address.php.

674  {
675  return $this->setData(OrderAddressInterface::VAT_IS_VALID, $vatIsValid);
676  }
setData($key, $value=null)
Definition: Address.php:179

◆ setVatRequestDate()

setVatRequestDate (   $vatRequestDate)

{Sets the VAT request date for the order address.

Parameters
string$vatRequestDate
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 697 of file Address.php.

698  {
699  return $this->setData(OrderAddressInterface::VAT_REQUEST_DATE, $vatRequestDate);
700  }
setData($key, $value=null)
Definition: Address.php:179

◆ setVatRequestId()

setVatRequestId (   $id)

{Sets the VAT request ID for the order address.

Parameters
string$id
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 681 of file Address.php.

◆ setVatRequestSuccess()

setVatRequestSuccess (   $vatRequestSuccess)

{Sets the VAT-request-success flag value for the order address.

Parameters
int$vatRequestSuccess
Returns
$this
}

Implements OrderAddressInterface.

Definition at line 705 of file Address.php.

706  {
707  return $this->setData(OrderAddressInterface::VAT_REQUEST_SUCCESS, $vatRequestSuccess);
708  }
setData($key, $value=null)
Definition: Address.php:179

Field Documentation

◆ $_eventObject

$_eventObject = 'address'
protected

Definition at line 44 of file Address.php.

◆ $_eventPrefix

$_eventPrefix = 'sales_order_address'
protected

Definition at line 39 of file Address.php.

◆ $order

$order
protected

Definition at line 34 of file Address.php.

◆ $orderFactory

$orderFactory
protected

Definition at line 49 of file Address.php.

◆ $regionFactory

$regionFactory
protected

Definition at line 54 of file Address.php.

◆ TYPE_BILLING

const TYPE_BILLING = 'billing'

Possible customer address types

Definition at line 27 of file Address.php.

◆ TYPE_SHIPPING

const TYPE_SHIPPING = 'shipping'

Definition at line 29 of file Address.php.


The documentation for this class was generated from the following file: