Clean code

This commit is contained in:
Laurent Destailleur 2015-03-17 10:52:27 +01:00
parent 689d270552
commit 4fffeb3a89
2 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -90,7 +90,7 @@ class Cotisation extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -140,7 +140,7 @@ class Cotisation extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -181,7 +181,7 @@ class Cotisation extends CommonObject
else else
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -217,7 +217,7 @@ class Cotisation extends CommonObject
$result=$member->fetch($this->fk_adherent); $result=$member->fetch($this->fk_adherent);
$result=$member->update_end_date($user); $result=$member->update_end_date($user);
if ($accountline->rowid > 0) // If we found bank account line (this means this->fk_bank defined) if ($accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
{ {
$result=$accountline->delete($user); // Return false if refused because line is conciliated $result=$accountline->delete($user); // Return false if refused because line is conciliated
if ($result > 0) if ($result > 0)

View File

@ -51,11 +51,6 @@ abstract class CommonObject
*/ */
public $errors; public $errors;
/**
* @var string Column name of the ref field.
*/
protected $table_ref_field = '';
/** /**
* @var context Can be used to pass information when only object is provied to method * @var context Can be used to pass information when only object is provied to method
*/ */
@ -86,6 +81,12 @@ abstract class CommonObject
*/ */
public $linkedObjects; public $linkedObjects;
/**
* @var string Column name of the ref field.
*/
protected $table_ref_field = '';
// Following var are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. // Following var are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.