Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Data Fields | |
const | TYPE_BILLING = 'billing' |
const | TYPE_SHIPPING = 'shipping' |
![]() | |
const | CUSTOM_ATTRIBUTES = 'custom_attributes' |
![]() | |
const | EXTENSION_ATTRIBUTES_KEY = 'extension_attributes' |
![]() | |
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) | |
![]() | |
filterCustomAttributes ($data) | |
initializeCustomAttributes () | |
convertCustomAttributeValues (array &$customAttributes) | |
getCustomAttributesCodes () | |
_setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes) | |
_getExtensionAttributes () | |
![]() | |
_construct () | |
_init ($resourceModel) | |
_setResourceModel ($resourceName, $collectionName=null) | |
_getResource () | |
_getEventData () | |
_beforeLoad ($modelId, $field=null) | |
_afterLoad () | |
_hasModelChanged () | |
_getValidatorBeforeSave () | |
_createValidatorBeforeSave () | |
_getValidationRulesBeforeSave () | |
_clearReferences () | |
_clearData () | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$order | |
$_eventPrefix = 'sales_order_address' | |
$_eventObject = 'address' | |
$orderFactory | |
$regionFactory | |
![]() | |
$extensionAttributesFactory | |
$extensionAttributes | |
$customAttributeFactory | |
$customAttributesCodes = null | |
$customAttributesChanged = false | |
![]() | |
$_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 = [] | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
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)
Definition at line 22 of file Address.php.
__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 = [] |
||
) |
\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.
|
protected |
explodeStreetAddress | ( | ) |
Create fields street1, street2, etc.
To be used in controllers for views data
Implements AddressModelInterface.
Definition at line 210 of file Address.php.
getAddressType | ( | ) |
Returns address_type
Implements OrderAddressInterface.
Definition at line 264 of file Address.php.
getCity | ( | ) |
Returns city
Implements OrderAddressInterface.
Definition at line 274 of file Address.php.
getCompany | ( | ) |
Returns company
Implements OrderAddressInterface.
Definition at line 284 of file Address.php.
getCountryId | ( | ) |
Returns country_id
Implements OrderAddressInterface.
Definition at line 294 of file Address.php.
getCustomerAddressId | ( | ) |
Returns customer_address_id
Implements OrderAddressInterface.
Definition at line 304 of file Address.php.
getCustomerId | ( | ) |
Returns customer_id
Implements OrderAddressInterface.
Definition at line 314 of file Address.php.
getEmail | ( | ) |
Returns email
Implements OrderAddressInterface.
Definition at line 324 of file Address.php.
getEntityId | ( | ) |
Returns entity_id
Implements OrderAddressInterface.
Definition at line 334 of file Address.php.
getExtensionAttributes | ( | ) |
{Retrieve existing extension attributes object or create a new one.
Implements OrderAddressInterface.
Definition at line 715 of file Address.php.
getFax | ( | ) |
Returns fax
Implements OrderAddressInterface.
Definition at line 355 of file Address.php.
getFirstname | ( | ) |
Returns firstname
Implements OrderAddressInterface.
Definition at line 365 of file Address.php.
getLastname | ( | ) |
Returns lastname
Implements OrderAddressInterface.
Definition at line 375 of file Address.php.
getMiddlename | ( | ) |
Returns middlename
Implements OrderAddressInterface.
Definition at line 385 of file Address.php.
getName | ( | ) |
getOrder | ( | ) |
getParentId | ( | ) |
Returns parent_id
Implements OrderAddressInterface.
Definition at line 395 of file Address.php.
getPostcode | ( | ) |
Returns postcode
Implements OrderAddressInterface.
Definition at line 405 of file Address.php.
getPrefix | ( | ) |
Returns prefix
Implements OrderAddressInterface.
Definition at line 415 of file Address.php.
getRegion | ( | ) |
Returns region
Implements OrderAddressInterface.
Definition at line 425 of file Address.php.
getRegionCode | ( | ) |
Return 2 letter state code if available, otherwise full region name
Implements OrderAddressInterface.
Definition at line 121 of file Address.php.
getRegionId | ( | ) |
Returns region_id
Implements OrderAddressInterface.
Definition at line 435 of file Address.php.
getStreet | ( | ) |
Retrieve street field of an address
Implements OrderAddressInterface.
Definition at line 237 of file Address.php.
getStreetLine | ( | $number | ) |
Get street line by number
int | $number |
Implements AddressModelInterface.
Definition at line 251 of file Address.php.
getSuffix | ( | ) |
Returns suffix
Implements OrderAddressInterface.
Definition at line 445 of file Address.php.
getTelephone | ( | ) |
Returns telephone
Implements OrderAddressInterface.
Definition at line 455 of file Address.php.
getVatId | ( | ) |
Returns vat_id
Implements OrderAddressInterface.
Definition at line 465 of file Address.php.
getVatIsValid | ( | ) |
Returns vat_is_valid
Implements OrderAddressInterface.
Definition at line 475 of file Address.php.
getVatRequestDate | ( | ) |
Returns vat_request_date
Implements OrderAddressInterface.
Definition at line 485 of file Address.php.
getVatRequestId | ( | ) |
Returns vat_request_id
Implements OrderAddressInterface.
Definition at line 495 of file Address.php.
getVatRequestSuccess | ( | ) |
Returns vat_request_success
Implements OrderAddressInterface.
Definition at line 505 of file Address.php.
|
protected |
Implode value of the street field, if it is present among other fields
array | $data |
Definition at line 195 of file Address.php.
|
protected |
Combine values of street lines into a single string
string[]|string | $value |
Definition at line 164 of file Address.php.
setAddressType | ( | $addressType | ) |
{Sets the address type for the order address.
string | $addressType |
Implements OrderAddressInterface.
Definition at line 625 of file Address.php.
setCity | ( | $city | ) |
{Sets the city for the order address.
string | $city |
Implements OrderAddressInterface.
Definition at line 585 of file Address.php.
setCompany | ( | $company | ) |
{Sets the company for the order address.
string | $company |
Implements OrderAddressInterface.
Definition at line 657 of file Address.php.
setCountryId | ( | $id | ) |
{Sets the country ID for the order address.
string | $id |
Implements OrderAddressInterface.
Definition at line 609 of file Address.php.
setCustomerAddressId | ( | $id | ) |
{Sets the country address ID for the order address.
int | $id |
Implements OrderAddressInterface.
Definition at line 521 of file Address.php.
setCustomerId | ( | $id | ) |
{Sets the customer ID for the order address.
int | $id |
Implements OrderAddressInterface.
Definition at line 545 of file Address.php.
setData | ( | $key, | |
$value = null |
|||
) |
Enforce format of the street field
array | string | $key | |
null | $value |
Definition at line 179 of file Address.php.
setEmail | ( | ) |
{Sets the email address for the order address.
string |
Implements OrderAddressInterface.
Definition at line 593 of file Address.php.
setEntityId | ( | $entityId | ) |
Sets the ID for the order address.
int | $entityId |
Implements OrderAddressInterface.
Definition at line 345 of file Address.php.
setExtensionAttributes | ( | \Magento\Sales\Api\Data\OrderAddressExtensionInterface | $extensionAttributes | ) |
{}
\Magento\Sales\Api\Data\OrderAddressExtensionInterface | $extensionAttributes |
Definition at line 726 of file Address.php.
setFax | ( | $fax | ) |
{Sets the fax number for the order address.
string | $fax |
Implements OrderAddressInterface.
Definition at line 553 of file Address.php.
setFirstname | ( | $firstname | ) |
{Sets the first name for the order address.
string | $firstname |
Implements OrderAddressInterface.
Definition at line 617 of file Address.php.
setLastname | ( | $lastname | ) |
{Sets the last name for the order address.
string | $lastname |
Implements OrderAddressInterface.
Definition at line 577 of file Address.php.
setMiddlename | ( | $middlename | ) |
{Sets the middle name for the order address.
string | $middlename |
Implements OrderAddressInterface.
Definition at line 641 of file Address.php.
setOrder | ( | \Magento\Sales\Model\Order | $order | ) |
Set order
@codeCoverageIgnore
\Magento\Sales\Model\Order | $order |
Definition at line 110 of file Address.php.
setParentId | ( | $id | ) |
{Sets the parent ID for the order address.
int | $id |
Implements OrderAddressInterface.
Definition at line 513 of file Address.php.
setPostcode | ( | $postcode | ) |
{Sets the postal code for the order address.
string | $postcode |
Implements OrderAddressInterface.
Definition at line 569 of file Address.php.
setPrefix | ( | $prefix | ) |
{Sets the prefix for the order address.
string | $prefix |
Implements OrderAddressInterface.
Definition at line 633 of file Address.php.
setRegion | ( | $region | ) |
{Sets the region for the order address.
string | $region |
Implements OrderAddressInterface.
Definition at line 561 of file Address.php.
setRegionCode | ( | $regionCode | ) |
{Set region code
string | $regionCode |
Implements OrderAddressInterface.
Definition at line 689 of file Address.php.
setRegionId | ( | $id | ) |
{Sets the region ID for the order address.
int | $id |
Implements OrderAddressInterface.
Definition at line 529 of file Address.php.
setStreet | ( | $street | ) |
{Sets the street values, if any, for the order address.
string|string[] | $street |
Implements OrderAddressInterface.
Definition at line 537 of file Address.php.
setSuffix | ( | $suffix | ) |
{Sets the suffix for the order address.
string | $suffix |
Implements OrderAddressInterface.
Definition at line 649 of file Address.php.
setTelephone | ( | $telephone | ) |
{Sets the telephone number for the order address.
string | $telephone |
Implements OrderAddressInterface.
Definition at line 601 of file Address.php.
setVatId | ( | $id | ) |
{Sets the VAT ID for the order address.
string | $id |
Implements OrderAddressInterface.
Definition at line 665 of file Address.php.
setVatIsValid | ( | $vatIsValid | ) |
{Sets the VAT-is-valid flag value for the order address.
int | $vatIsValid |
Implements OrderAddressInterface.
Definition at line 673 of file Address.php.
setVatRequestDate | ( | $vatRequestDate | ) |
{Sets the VAT request date for the order address.
string | $vatRequestDate |
Implements OrderAddressInterface.
Definition at line 697 of file Address.php.
setVatRequestId | ( | $id | ) |
{Sets the VAT request ID for the order address.
string | $id |
Implements OrderAddressInterface.
Definition at line 681 of file Address.php.
setVatRequestSuccess | ( | $vatRequestSuccess | ) |
{Sets the VAT-request-success flag value for the order address.
int | $vatRequestSuccess |
Implements OrderAddressInterface.
Definition at line 705 of file Address.php.
|
protected |
Definition at line 44 of file Address.php.
|
protected |
Definition at line 39 of file Address.php.
|
protected |
Definition at line 34 of file Address.php.
|
protected |
Definition at line 49 of file Address.php.
|
protected |
Definition at line 54 of file Address.php.
const TYPE_BILLING = 'billing' |
Possible customer address types
Definition at line 27 of file Address.php.
const TYPE_SHIPPING = 'shipping' |
Definition at line 29 of file Address.php.