}
}
- if ($this->type == self::LINK_PROFILE) {
- if (!is_null($this->flags)) {
- $this->flags = new PlFlagSet($this->flags);
- } else {
- static $flags = array('current', 'temporary', 'secondary', 'mail');
-
- $this->flags = new PlFlagSet();
- foreach ($flags as $flag) {
- if (!is_null($this->$flag) && ($this->$flag == 1 || $this->$flag == 'on')) {
- $this->flags->addFlag($flag, 1);
- $this->$flag = null;
- }
- $this->flags->addFlag('cedex', (strpos(strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"),
- array('', "\n"), $this->text)), 'CEDEX')) !== false);
+ if (!is_null($this->flags)) {
+ $this->flags = new PlFlagSet($this->flags);
+ } else {
+ static $flags = array('current', 'temporary', 'secondary', 'mail');
+
+ $this->flags = new PlFlagSet();
+ foreach ($flags as $flag) {
+ if (!is_null($this->$flag) && ($this->$flag == 1 || $this->$flag == 'on')) {
+ $this->flags->addFlag($flag, 1);
+ $this->$flag = null;
}
+ $this->flags->addFlag('cedex', (strpos(strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"),
+ array('', "\n"), $this->text)), 'CEDEX')) !== false);
}
}
}
+ public function setId($id)
+ {
+ $this->id = $id;
+ }
+
public function phones()
{
return $this->phones;
public function hasFlag($flag)
{
- return $this->flags->hasFlag($flag);
+ return ($this->flags != null && $this->flags->hasFlag($flag));
}
public function format(array $format = array())
$mailer->send();
}
}
+ if ($this->countryId == '') {
+ $this->countryId = null;
+ }
$this->geocodeChosen = null;
$this->phones = Phone::formatFormArray($this->phones, $this->error);
return !$this->error;
LEFT JOIN geoloc_administrativeareas AS ga ON (ga.id = pa.administrativeAreaId)
LEFT JOIN geoloc_subadministrativeareas AS gs ON (gs.id = pa.subAdministrativeAreaId)
LEFT JOIN geoloc_countries AS gc ON (gc.iso_3166_1_a2 = pa.countryId)
- WHERE ' . implode(' AND ', $where) . '
+ ' . ((count($where) > 0) ? 'WHERE ' . implode(' AND ', $where) : '') . '
ORDER BY pa.pid, pa.jobid, pa.id';
$this->dbiter = XDB::iterator($sql);
}