1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\Database\Connection;
13: use Xoops\Core\Kernel\XoopsObject;
14: use Xoops\Core\Kernel\XoopsPersistableObjectHandler;
15:
16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
27:
28: class ProfileRegstep extends XoopsObject
29: {
30: public function __construct()
31: {
32: $this->initVar('step_id', XOBJ_DTYPE_INT);
33: $this->initVar('step_name', XOBJ_DTYPE_TXTBOX);
34: $this->initVar('step_desc', XOBJ_DTYPE_TXTAREA);
35: $this->initVar('step_order', XOBJ_DTYPE_INT, 1);
36: $this->initVar('step_save', XOBJ_DTYPE_INT, 0);
37: }
38: }
39:
40: class ProfileRegstepHandler extends XoopsPersistableObjectHandler
41: {
42: 43: 44:
45: public function __construct(Connection $db = null)
46: {
47: parent::__construct($db, 'profile_regstep', 'profileregstep', 'step_id', 'step_name');
48: }
49:
50: 51: 52: 53: 54: 55: 56: 57: 58:
59: public function deleteRegstep(XoopsObject $obj, $force = false)
60: {
61: if (parent::delete($obj, $force)) {
62: $field_handler = \Xoops::getModuleHelper('profile')->getHandler('field');
63: return $field_handler->updateAll('step_id', 0, new Criteria('step_id', $obj->getVar('step_id')));
64: }
65: return false;
66: }
67: }
68: