Bitrix API

Address

FinalYes

Class Address

Table of Contents

Methods

__construct()  : mixed
Address constructor.
addLink()  : void
Link entity to address
clearLinks()  : void
Removes all links
delete()  : DeleteResult
Delete the address
fromArray()  : Address
Create the Address from Array
fromJson()  : Address
Create the Address from JSON
getAllFieldsValues()  : array<string|int, mixed>
Get all fields values from the address
getFieldValue()  : string|null
Get address field value
getId()  : int
getLanguageId()  : string
getLatitude()  : string
getLinks()  : AddressLinkCollection
getLocation()  : Location
getLongitude()  : string
hasLinks()  : bool
Check if Address has links or not
isFieldExist()  : bool
Check if field exist
load()  : Address|bool|null
Load the Address
save()  : AddResult|Result|UpdateResult
Save the Address
setFieldValue()  : $this
Set address field value
setId()  : $this
setLatitude()  : Address
setLinks()  : void
setLocation()  : self
setLongitude()  : Address
toArray()  : array<string|int, mixed>
Convert the Address to Array
toJson()  : string
Convert the Address to JSON
toString()  : string
Convert Address to String

Methods

__construct()

Address constructor.

public __construct(string $languageId) : mixed
Parameters
$languageId : string

Link entity to address

public addLink(string $entityId, string $entityType) : void
Parameters
$entityId : string
$entityType : string
Tags
throws
ArgumentNullException

Removes all links

public clearLinks() : void

fromArray()

Create the Address from Array

public static fromArray(array<string|int, mixed> $arrayData) : Address
Parameters
$arrayData : array<string|int, mixed>
Return values
Address

fromJson()

Create the Address from JSON

public static fromJson(string $jsonData) : Address
Parameters
$jsonData : string
Tags
throws
ArgumentException
Return values
Address

getAllFieldsValues()

Get all fields values from the address

public getAllFieldsValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldValue()

Get address field value

public getFieldValue(int $type) : string|null
Parameters
$type : int

Field type. See \Bitrix\Location\Entity\Address\FieldType

Return values
string|null

getId()

public getId() : int
Return values
int

getLanguageId()

public getLanguageId() : string
Return values
string

getLatitude()

public getLatitude() : string
Return values
string
public getLinks() : AddressLinkCollection
Return values
AddressLinkCollection

getLongitude()

public getLongitude() : string
Return values
string

Check if Address has links or not

public hasLinks() : bool
Return values
bool

isFieldExist()

Check if field exist

public isFieldExist(int $type) : bool
Parameters
$type : int

Field type. See \Bitrix\Location\Entity\Address\FieldType

Return values
bool

load()

Load the Address

public static load(int $id) : Address|bool|null
Parameters
$id : int
Tags
throws
SystemException
throws
ArgumentException
throws
ObjectPropertyException
Return values
Address|bool|null

setFieldValue()

Set address field value

public setFieldValue(int $type, string $value) : $this
Parameters
$type : int

Field type. See \Bitrix\Location\Entity\Address\FieldType

$value : string

Field value

Tags
throws
SystemException
Return values
$this

setId()

public setId(int $id) : $this
Parameters
$id : int
Return values
$this

setLatitude()

public setLatitude(string $latitude) : Address
Parameters
$latitude : string
Return values
Address
public setLinks(AddressLinkCollection $collection) : void
Parameters
$collection : AddressLinkCollection

setLocation()

public setLocation(Location|null $location) : self
Parameters
$location : Location|null
Return values
self

setLongitude()

public setLongitude(string $longitude) : Address
Parameters
$longitude : string
Return values
Address

toArray()

Convert the Address to Array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

toJson()

Convert the Address to JSON

public toJson() : string
Tags
throws
ArgumentException
Return values
string

Json

toString()

Convert Address to String

public toString(Format $format[, string $strategyType = StringConverter::STRATEGY_TYPE_TEMPLATE ][, string $contentType = StringConverter::CONTENT_TYPE_HTML ]) : string
Parameters
$format : Format

Address format

$strategyType : string = StringConverter::STRATEGY_TYPE_TEMPLATE

See StringConverter::STRATEGY_*

$contentType : string = StringConverter::CONTENT_TYPE_HTML

See StringConverter::CONTENT_TYPE_*

Tags
throws
ArgumentOutOfRangeException
Return values
string

        
On this page

Search results