|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Suico; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Extended User Profile |
|
7
|
|
|
* |
|
8
|
|
|
* You may not change or alter any portion of this comment or credits |
|
9
|
|
|
* of supporting developers from this source code or any supporting source code |
|
10
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
11
|
|
|
* This program is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) |
|
16
|
|
|
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) |
|
17
|
|
|
* @since 2.3.0 |
|
18
|
|
|
* @author Jan Pedersen |
|
19
|
|
|
* @author Taiwen Jiang <[email protected]> |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class RegstepHandler |
|
24
|
|
|
*/ |
|
25
|
|
|
class RegstepHandler extends \XoopsPersistableObjectHandler |
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* @param \XoopsDatabase|null $db |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct(\XoopsDatabase $db = null) |
|
31
|
|
|
{ |
|
32
|
|
|
parent::__construct($db, 'suico_profile_regstep', Regstep::class, 'step_id', 'step_name'); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* Delete an object from the database |
|
37
|
|
|
* @param \XoopsObject $object |
|
38
|
|
|
* @param bool $force |
|
39
|
|
|
* |
|
40
|
|
|
* @return bool |
|
41
|
|
|
* @see XoopsPersistableObjectHandler |
|
42
|
|
|
*/ |
|
43
|
|
|
public function delete(\XoopsObject $object, $force = false) |
|
44
|
|
|
{ |
|
45
|
|
|
if (parent::delete($object, $force)) { |
|
46
|
|
|
$fieldHandler = Helper::getInstance()->getHandler('Field'); |
|
47
|
|
|
|
|
48
|
|
|
return $fieldHandler->updateAll('step_id', 0, new \Criteria('step_id', $object->getVar('step_id')), $force); |
|
|
|
|
|
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
return false; |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|