Revision ef37f43f class/myclass.class.php

b/class/myclass.class.php
23 23
 *
24 24
 * Put detailed description here.
25 25
 */
26
// Put here all includes required by your class file
26

  
27
/** Includes */
27 28
//require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
28 29
//require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
29 30
//require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
......
34 35
class MyClass // extends CommonObject
35 36
{
36 37

  
37
	private $db; //!< To store db handler
38
	public $error; //!< To return error code (or message)
39
	public $errors = array(); //!< To return several error codes (or messages)
40
	//public $element='skeleton';	//!< Id that identify managed objects
41
	//public $table_element='skeleton';	//!< Name of table without prefix where object is stored
38
    /** @var DoliDb Database handler */
39
	private $db;
40
    /** @var string Error code or message */
41
	public $error;
42
    /** @var array Several error codes or messages */
43
	public $errors = array();
44
    /** @var string Id to identify managed object */
45
	//public $element='myelement';
46
    /** @var string Name of table without prefix where object is stored */
47
	//public $table_element='mytable';
48
    /** @var int An example ID */
42 49
	public $id;
50
    /** @var mixed An example property */
43 51
	public $prop1;
52
    /** @var mixed An example property */
44 53
	public $prop2;
45 54

  
46 55
	/**
47 56
	 * Constructor
48 57
	 *
49
	 * 	@param	DoliDb		$db		Database handler
58
	 * @param DoliDb $db Database handler
50 59
	 */
51 60
	public function __construct($db)
52 61
	{
......
58 67
	/**
59 68
	 * Create object into database
60 69
	 *
61
	 * 	@param		User	$user		User that create
62
	 * 	@param		int		$notrigger	0=launch triggers after, 1=disable triggers
63
	 * 	@return		int					<0 if KO, Id of created object if OK
70
	 * @param User $user User that create
71
	 * @param int $notrigger 0=launch triggers after, 1=disable triggers
72
	 * @return int <0 if KO, Id of created object if OK
64 73
	 */
65 74
	public function create($user, $notrigger = 0)
66 75
	{
......
131 140
	/**
132 141
	 * Load object in memory from database
133 142
	 *
134
	 * 	@param		int		$id	Id object
135
	 * 	@return		int			<0 if KO, >0 if OK
143
	 * @param int $id Id object
144
	 * @return int <0 if KO, >0 if OK
136 145
	 */
137 146
	public function fetch($id)
138 147
	{
......
170 179
	/**
171 180
	 * Update object into database
172 181
	 *
173
	 * 	@param		User	$user		User that modify
174
	 * 	@param		int		$notrigger	0=launch triggers after, 1=disable triggers
175
	 * 	@return		int					<0 if KO, >0 if OK
182
	 * @param User $user User that modify
183
	 * @param int $notrigger 0=launch triggers after, 1=disable triggers
184
	 * @return int <0 if KO, >0 if OK
176 185
	 */
177 186
	public function update($user = 0, $notrigger = 0)
178 187
	{
......
237 246
	/**
238 247
	 * Delete object in database
239 248
	 *
240
	 * 	@param		User	$user		User that delete
241
	 * 	@param		int		$notrigger	0=launch triggers after, 1=disable triggers
242
	 * 	@return		int					<0 if KO, >0 if OK
249
	 * @param User $user User that delete
250
	 * @param int $notrigger 0=launch triggers after, 1=disable triggers
251
	 * @return int <0 if KO, >0 if OK
243 252
	 */
244 253
	public function delete($user, $notrigger = 0)
245 254
	{
......
292 301
	/**
293 302
	 * Load an object from its id and create a new one in database
294 303
	 *
295
	 * 	@param		int		$fromid		Id of object to clone
296
	 * 	@return		int					New id of clone
304
	 * @param int $fromid Id of object to clone
305
	 * @return int New id of clone
297 306
	 */
298 307
	public function createFromClone($fromid)
299 308
	{
......
341 350
	 * Initialise object with example values
342 351
	 * Id must be 0 if object instance is a specimen
343 352
	 *
344
	 * 	@return		void
353
	 * @return void
345 354
	 */
346 355
	public function initAsSpecimen()
347 356
	{

Also available in: Unified diff