| Server IP : 162.214.74.102 / Your IP : 216.73.217.114 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/leo/application/plugins/module_imobles/factories/ |
Upload File : |
<?php
include_once "Factory.php";
class NeighborhoodFactory extends Factory {
public static function create($data, $neighborhood, $create = false, $update = false) {
// global $_c;
// Instancio o Helper para a função para sanitizar o endereço
$crawlerHelper = new CrawlerHelper();
if (!isset($data['sanitized_name']) || empty($data['sanitized_name'])) {
$data['sanitized_name'] = $crawlerHelper->sanitizaLogradouro($data['name']);
}
$neighborhood->name = $data['name'];
$neighborhood->city_id = $data['city_id'];
$neighborhood->state_id = $data['state_id'];
$neighborhood->google_place_id = @$data['google_place_id'];
$neighborhood->preposition = empty($data['preposition']) ? 'On' : $data['preposition'];
$neighborhood->sanitized_name = $data['sanitized_name'];
if (is_array(@$data['alternative_names'])) {
$neighborhood->alternative_names = json_encode($data['alternative_names']);
} else {
$neighborhood->alternative_names = json_encode(array());
}
if(isset($data["params"]) && !empty($data["params"])) {
$neighborhood->params = json_encode($data["params"]);
}
if(isset($data["google_details"]) && !empty($data["google_details"])) {
$neighborhood->google_details = json_encode($data["google_details"]);
}
$user = User::_info();
if ($create) {
$neighborhood->created_at = date('Y-m-d H:i:s');
// $neighborhood->default = 0;
$neighborhood->created_by = $user->id;
}
if ($update) {
$neighborhood->updated_at = date('Y-m-d H:i:s');
$neighborhood->updated_by = $user->id;
}
return $neighborhood;
}
}