fix imports js
This commit is contained in:
parent
ada9fa4029
commit
f785e67f49
6 changed files with 163 additions and 42 deletions
|
@ -22,7 +22,7 @@ class Place
|
|||
#[ORM\Column(length: 10)]
|
||||
private ?string $osm_kind = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column]
|
||||
|
@ -252,20 +252,31 @@ class Place
|
|||
|
||||
// Setters from tags
|
||||
$this->setName($tags['name'] ?? null);
|
||||
$this->setStreet($tags['addr:street'] ?? $tags['contact:street'] ?? null);
|
||||
$this->setHousenumber($tags['addr:housenumber'] ?? $tags['contact:housenumber'] ?? null);
|
||||
|
||||
$street = isset($tags['addr:street']) ? $tags['addr:street'] : (isset($tags['contact:street']) ? $tags['contact:street'] : null);
|
||||
$this->setStreet($street);
|
||||
|
||||
$housenumber = isset($tags['addr:housenumber']) ? $tags['addr:housenumber'] : (isset($tags['contact:housenumber']) ? $tags['contact:housenumber'] : null);
|
||||
$this->setHousenumber($housenumber);
|
||||
|
||||
if (isset($tags['addr:postcode'])) {
|
||||
$this->setZipCode(intval($tags['addr:postcode']));
|
||||
}
|
||||
$this->setEmail($tags['contact:email'] ?? $tags['email'] ?? null);
|
||||
$this->setSiret($tags['ref:FR:SIRET'] ?? null);
|
||||
|
||||
$email = isset($tags['contact:email']) ? $tags['contact:email'] : (isset($tags['email']) ? $tags['email'] : null);
|
||||
$this->setEmail($email);
|
||||
|
||||
$siret = isset($tags['ref:FR:SIRET']) ? $tags['ref:FR:SIRET'] : null;
|
||||
$this->setSiret($siret);
|
||||
|
||||
// Boolean "has" properties
|
||||
$this->setHasOpeningHours(!empty($tags['opening_hours']));
|
||||
$this->setHasWheelchair(!empty($tags['wheelchair']));
|
||||
|
||||
// has address logic
|
||||
$this->setHasAddress(!empty($this->getStreet()) && !empty($this->getHousenumber()));
|
||||
|
||||
$this->setHasAddress(!empty($this->getStreet()) && !empty($this->getHousenumber())
|
||||
| (isset($tags['addr:street']) && isset($tags['addr:housenumber'])) );
|
||||
|
||||
// has website logic (with multiple possible tags)
|
||||
$websiteTags = ['website', 'contact:website', 'url', 'contact:url'];
|
||||
|
@ -277,6 +288,7 @@ class Place
|
|||
}
|
||||
}
|
||||
$this->setHasWebsite($hasWebsite);
|
||||
|
||||
|
||||
// has note logic
|
||||
$noteContent = '';
|
||||
|
@ -335,7 +347,7 @@ class Place
|
|||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
public function setEmail(?string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue