Fix indent ++
This commit is contained in:
parent
d45f81a515
commit
541c5820bc
16 changed files with 415 additions and 417 deletions
|
|
@ -41,7 +41,7 @@ class Client
|
|||
{
|
||||
throw new UserException('Le champs '.$key.' doit être renseigné.');
|
||||
}
|
||||
|
||||
|
||||
if($key == 'ville')
|
||||
{
|
||||
$data[$key] = mb_strtoupper($data[$key]);
|
||||
|
|
@ -50,7 +50,7 @@ class Client
|
|||
{
|
||||
if($this->config['validate_cp'] && !preg_match('/^(F-)?((2[A|B])|[0-9]{2})(\s)?[0-9]{3}$/', $data[$key]))
|
||||
{
|
||||
throw new UserException('Le code postal est erroné.');
|
||||
throw new UserException('Le code postal est erroné.');
|
||||
}
|
||||
}
|
||||
elseif ($key == "telephone")
|
||||
|
|
@ -80,26 +80,26 @@ class Client
|
|||
|
||||
$this->_checkFields($data);
|
||||
|
||||
if($this->config['unique_client_name'] && isset($data['nom']) && $db->test('plugin_facturation_clients', 'nom = ? COLLATE NOCASE', $data['nom']))
|
||||
{
|
||||
throw new UserException('La valeur du champ nom est déjà utilisée, hors ce champ doit être unique à chaque client.');
|
||||
}
|
||||
if($this->config['unique_client_name'] && isset($data['nom']) && $db->test('plugin_facturation_clients', 'nom = ? COLLATE NOCASE', $data['nom']))
|
||||
{
|
||||
throw new UserException('La valeur du champ nom est déjà utilisée, hors ce champ doit être unique à chaque client.');
|
||||
}
|
||||
|
||||
$db->insert('plugin_facturation_clients', $data);
|
||||
$db->insert('plugin_facturation_clients', $data);
|
||||
return $db->lastInsertRowId();
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
|
||||
return $db->first('SELECT *, strftime(\'%s\', date_creation) AS date_creation
|
||||
FROM plugin_facturation_clients WHERE id = ? LIMIT 1;', (int)$id);
|
||||
}
|
||||
return $db->first('SELECT *, strftime(\'%s\', date_creation) AS date_creation
|
||||
FROM plugin_facturation_clients WHERE id = ? LIMIT 1;', (int)$id);
|
||||
}
|
||||
|
||||
public function listAll()
|
||||
{
|
||||
return DB::getInstance()->get('SELECT *, strftime(\'%s\', date_creation) AS date_creation FROM plugin_facturation_clients');
|
||||
return DB::getInstance()->get('SELECT *, strftime(\'%s\', date_creation) AS date_creation FROM plugin_facturation_clients');
|
||||
}
|
||||
|
||||
public function edit($id, $data = [])
|
||||
|
|
@ -108,10 +108,10 @@ class Client
|
|||
|
||||
$this->_checkFields($data);
|
||||
|
||||
if($this->config['unique_client_name'] && isset($data['nom']) && $db->test('plugin_facturation_clients', 'nom = ? COLLATE NOCASE AND id != ?', $data['nom'], (int)$id))
|
||||
{
|
||||
throw new UserException('La valeur du champ nom est déjà utilisée, hors ce champ doit être unique à chaque client.');
|
||||
}
|
||||
if($this->config['unique_client_name'] && isset($data['nom']) && $db->test('plugin_facturation_clients', 'nom = ? COLLATE NOCASE AND id != ?', $data['nom'], (int)$id))
|
||||
{
|
||||
throw new UserException('La valeur du champ nom est déjà utilisée, hors ce champ doit être unique à chaque client.');
|
||||
}
|
||||
|
||||
return $db->update('plugin_facturation_clients', $data, $db->where('id', (int)$id));
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ class Client
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return DB::getInstance()->delete('plugin_facturation_clients', 'id = '. (int)$id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue