From 52ae26ccc691aafaa9fc1778b3770997bc03b408 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2011 12:27:29 +0000 Subject: [PATCH] Qual: More POO --- htdocs/core/class/commonobject.class.php | 7 ++++--- htdocs/societe/class/societe.class.php | 21 +++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe10778d1da..f22692f6da0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -31,9 +31,10 @@ abstract class CommonObject { - var $db; - - var $canvas; // Contains canvas name if it is + protected $db; + public $error; + public $errors; + public $canvas; // Contains canvas name if it is // No constructor as it is an abstract class diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d778ad4b619..2b5762b3325 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -36,15 +36,11 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Societe extends CommonObject { - var $db; - var $error; - var $errors=array(); - - var $element='societe'; - var $table_element = 'societe'; - var $fk_element='fk_soc'; - var $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='societe'; + public $table_element = 'societe'; + public $fk_element='fk_soc'; + public $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $name; // TODO obsolete @@ -136,8 +132,6 @@ class Societe extends CommonObject var $commercial_id; //Id du commercial affecte var $default_lang; - var $canvas; - var $ref_int; var $import_key; @@ -148,10 +142,9 @@ class Societe extends CommonObject /** * Constructor * - * @param DB handler acces base de donnees - * @param id id societe (0 par defaut) + * @param DoliDB $DB Database handler */ - function Societe($DB, $id=0) + public function Societe($DB) { global $conf;