for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GeoFixer\models\queries;
/**
* Class SettlementsDatabaseQuery
*
* @package GeoFixer\models\queries
*/
class SettlementsDatabaseQuery extends AbstractDatabaseQuery
{
* SettlementsDatabaseQuery constructor.
public function __construct()
parent::__construct();
}
* Получаем города и поселения
* @return $this
public function getSettlements()
$this->db = $this->db->select([self::FIAS_CODE, self::TITLE, self::KLADR_CODE])->from('fias_address_object');
return $this;
* Address level равен городу или поселению
* @param bool $full_settlements
public function addressLevel($full_settlements = false)
if ($full_settlements == false) {
===
When comparing two booleans, it is generally considered safer to use the strict comparison operator.
$this->db = $this->db->andWhere(['address_level' => self::CITY]);
} else {
$this->db = $this->db->andWhere(['OR' => [['address_level' => self::CITY], ['address_level' => self::SETTLEMENT]]]);
When comparing two booleans, it is generally considered safer to use the strict comparison operator.