Enhanced boxes model documentation

This commit is contained in:
Raphaël Doursenaud 2014-08-21 12:39:17 +02:00
parent c3b30893fc
commit 2c1e892efe

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* 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
@ -25,25 +26,82 @@
/** /**
* Parent class of boxes * Class ModeleBoxes
*
* Boxes parent class
*/ */
class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" boxes class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" boxes
{ {
var $db; /**
var $error=''; * @var DoliDB Database handler
var $max=5; */
var $enabled=1; public $db;
var $rowid; /**
var $id; * @var string Error message
var $position; */
var $box_order; public $error = '';
var $fk_user;
var $sourcefile;
var $class;
var $box_id;
var $note;
/**
* @var int Maximum lines
*/
public $max = 5;
/**
* @var int Status
*/
public $enabled=1;
/**
* @var int Box definition database ID
*/
public $rowid;
/**
* @var int ID
* @deprecated Same as box_id?
*/
public $id;
/**
* @var int Position?
*/
public $position;
/**
* @var string Display order
*/
public $box_order;
/**
* @var int User ID
*/
public $fk_user;
/**
* @var string Source file
*/
public $sourcefile;
/**
* @var string Class name
*/
public $class;
/**
* @var string ID
*/
public $box_id;
/**
* @var string Alphanumeric ID
*/
public $boxcode;
/**
* @var string Note
*/
public $note;
/** /**
* Constructor * Constructor
@ -71,6 +129,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
* Load a box line from its rowid * Load a box line from its rowid
* *
* @param int $rowid Row id to load * @param int $rowid Row id to load
*
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) function fetch($rowid)
@ -110,10 +169,11 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
/** /**
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) *Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
*
* @return void * @return void
*/ */
function showBox($head, $contents) function showBox($head, $contents)