3namespace Bitrix\Location\Entity;
5use Bitrix\Location\Entity\Location\Converter\ArrayConverter;
6use Bitrix\Location\Entity\Location\Field;
7use Bitrix\Location\Entity\Location\FieldCollection;
8use Bitrix\Location\Entity\Location\Type;
9use Bitrix\Location\Entity\Location\Parents;
10use Bitrix\Location\Service;
11use Bitrix\Main\ArgumentOutOfRangeException;
12use Bitrix\Main\Web\Json;
30 protected $type = Type::UNKNOWN;
41 private $fieldCollection;
65 $candidateParents = $childCandidate->
getParents();
67 if(!$candidateParents)
72 return $candidateParents->isContain($this);
90 return $parents->isContain($parentCandidate);
107 || $this->getSourceCode() !==
'' ||
$location->getSourceCode() !==
'')
111 && $this->getSourceCode() ===
$location->getSourceCode())
155 if($thisParents && $otherParents && !$thisParents->isEqualTo($otherParents))
170 return $this->parents;
179 if($this->parents ===
null)
215 $this->parents->setDescendant($this);
224 return $this->externalId;
242 return $this->languageId;
299 if($this->address ===
null)
301 $this->address = Location\Converter\AddressConverter::convertToAddress($this);
304 return $this->address;
358 return $this->sourceCode;
388 if(!Type::isValueExist(
$type))
406 ->setCode($otherLocation->
getCode())
409 ->setType($otherLocation->
getType())
410 ->setName($otherLocation->
getName())
426 return $this->latitude;
444 return $this->longitude;
503 return \Bitrix\Location\Entity\Location\Converter\ArrayConverter::convertToArray($this);
515 unserialize($serialized, [
'allowed_classes' =>
false])
536 return ArrayConverter::convertToArray($this);
541 return Json::encode($this->
toArray());
552 return ArrayConverter::convertFromArray(
$location);
565 if($field = $this->fieldCollection->getItemByType(
$type))
567 $field->setValue($value);
571 $this->fieldCollection->addItem(
588 foreach ($this->fieldCollection as $field)
590 $result[$field->getType()] = $field->getValue();
604 if($field = $this->fieldCollection->getItemByType(
$type))
620 return (
bool)$this->fieldCollection->getItemByType(
$type);
629 return $this->fieldCollection;
setLatitude(string $latitude)
copyDataFrom(Location $otherLocation)
setExternalId(string $externalId)
__unserialize(array $data)
isChildOf(Location $parentCandidate)
setFieldValue(int $type, string $value)
setAddress(Address $address)
setLongitude(string $longitude)
isParentOf(Location $childCandidate)
setLanguageId(string $languageId)
static fromArray(array $location)
getParentByType(int $type)
static load(int $id, string $languageId=LANGUAGE_ID)
setParents(Parents $parents)
isEqualTo(Location $location)
getParentByLevel(int $level)
setSourceCode($sourceCode)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code