\BXmaker\GeoIP\Location\Search\Item
-
Класс для работы с данными найденного местопложения
namespace BXmaker\GeoIP\Location\Search;
class Item implements \JsonSerializable, \Stringable
{
//...
}
public \BXmaker\GeoIP\Location\Search\Item::TYPE_COUNTRY = 'COUNTRY'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_COUNTRY_AREA = 'COUNTRY_AREA'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_REGION = 'REGION'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_SUBREGION = 'SUBREGION'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_CITY = 'CITY'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_VILLAGE = 'VILLAGE'
public \BXmaker\GeoIP\Location\Search\Item::TYPE_STREET = 'STREET'
public function __toString();
Создаст объект местоположения, добавит в коллекцию и вернет его
/**
* @return \BXmaker\GeoIP\Location\Search\Item
*/
public function createComponent();
/**
* @return $this
*/
public function deleteComponents();
/**
* @return string|null
*/
public function getCode();
/**
* @return array
*/
public function getComponents() : array;
public function getCountryName();
/**
* @return int|null
*/
public function getId();
/**
* @return string|null
*/
public function getName();
/**
* @return string|null
*/
public function getPostalCode();
public function getRegionName();
/**
* @return string|null
*/
public function getType();
public function jsonSerialize();
Добавление комопнента в конец
/**
* @param \BXmaker\GeoIP\Location\Search\Item $oItem
* @return $this;
*/
public function pushComponent(\BXmaker\GeoIP\Location\Search\Item $oItem);
/**
* @param string|null $code
* @return $this
*/
public function setCode($code);
/**
* @param $id
* @return $this
*/
public function setId($id);
/**
* @param string|null $name
* @return $this
*/
public function setName($name);
/**
* @param string|null $postalCode
* @return $this
*/
public function setPostalCode($postalCode);
Установка типа, например \BXmaker\GeoIP\Location\Search\Item::TYPE_COUNTRY
/**
* @param string|null $type
* @return $this
*/
public function setType($type);
public function setTypeCity();
public function setTypeCountry();
public function setTypeCountryArea();
public function setTypeRegion();
public function setTypeStreet();
public function setTypeSubRegion();
public function setTypeVillage();
Добавление компонента в начало
/**
* @param \BXmaker\GeoIP\Location\Search\Item $oItem
* @return $this
*/
public function unshiftComponent(\BXmaker\GeoIP\Location\Search\Item $oItem);