dolibarr 21.0.0-alpha
fournisseur.commande.dispatch.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2024 Christophe Battarel <christophe@altairis.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
29// Put here all includes required by your class file
30require_once DOL_DOCUMENT_ROOT."/reception/class/receptionlinebatch.class.php";
31
32
38{
42 public $element = 'commandefournisseurdispatch';
46 public $fk_commande;
50 public $fk_commandefourndet;
51
52
60 public function create($user, $notrigger = 0)
61 {
62 if (empty($this->fk_element) && !empty($this->fk_commande)) {
63 $this->fk_element = $this->fk_commande;
64 }
65 if (empty($this->fk_elementdet) && !empty($this->fk_commandefourndet)) {
66 $this->fk_elementdet = $this->fk_commandefourndet;
67 }
68
69 return parent::create($user, $notrigger);
70 }
71
79 public function fetch($id, $ref = '')
80 {
81 $ret = parent::fetch($id, $ref);
82 if ($ret > 0) {
83 $this->fk_commande = $this->fk_element;
84 $this->fk_commandefourndet = $this->fk_elementdet;
85 }
86 return $ret;
87 }
88
96 public function update($user, $notrigger = 0)
97 {
98 $this->fk_element = $this->fk_commande;
99 $this->fk_elementdet = $this->fk_commandefourndet;
100
101 return parent::update($user, $notrigger);
102 }
103}
Class to manage table ReceptionLineBatch.
update($user, $notrigger=0)
Update object into database.
fetch($id, $ref='')
Load object in memory from the database.
create($user, $notrigger=0)
Create object into database.
Class to manage table commandefournisseurdispatch.