1: <?php
2: /**
3: * Extended User Profile
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
8: * This program is distributed in the hope that it will be useful,
9: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
13: * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
14: * @package profile
15: * @since 2.3.0
16: * @author Jan Pedersen
17: * @author Taiwen Jiang <phppp@users.sourceforge.net>
18: */
19:
20: // defined('XOOPS_ROOT_PATH') || exit("XOOPS root path not defined");
21:
22: /**
23: * Class ProfileRegstep
24: */
25: class ProfileRegstep extends XoopsObject
26: {
27: public $step_id;
28: public $step_name;
29: public $step_desc;
30: public $step_order;
31: public $step_save;
32:
33: /**
34: *
35: */
36: public function __construct()
37: {
38: $this->initVar('step_id', XOBJ_DTYPE_INT);
39: $this->initVar('step_name', XOBJ_DTYPE_TXTBOX);
40: $this->initVar('step_desc', XOBJ_DTYPE_TXTAREA);
41: $this->initVar('step_order', XOBJ_DTYPE_INT, 1);
42: $this->initVar('step_save', XOBJ_DTYPE_INT, 0);
43: }
44: }
45:
46: /**
47: * Class ProfileRegstepHandler
48: */
49: class ProfileRegstepHandler extends XoopsPersistableObjectHandler
50: {
51: /**
52: * @param null|object $db
53: */
54: public function __construct($db)
55: {
56: parent::__construct($db, 'profile_regstep', 'profileregstep', 'step_id', 'step_name');
57: }
58:
59: /**
60: * Delete an object from the database
61: * @see XoopsPersistableObjectHandler
62: *
63: * @param XoopsObject $obj
64: * @param bool $force
65: *
66: * @return bool
67: */
68: public function delete(XoopsObject $obj, $force = false)
69: {
70: if (parent::delete($obj, $force)) {
71: $field_handler = xoops_getModuleHandler('field');
72:
73: return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')), $force);
74: }
75:
76: return false;
77: }
78: }
79: