1: <?php
  2: /*
  3:  You may not change or alter any portion of this comment or credits
  4:  of supporting developers from this source code or any supporting source code
  5:  which is considered copyrighted (c) material of the original comment or credit authors.
  6: 
  7:  This program is distributed in the hope that it will be useful,
  8:  but WITHOUT ANY WARRANTY; without even the implied warranty of
  9:  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 10:  */
 11: 
 12: /**
 13:  * Userconfigs
 14:  *
 15:  * @copyright       XOOPS Project (http://xoops.org)
 16:  * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 17:  * @author          trabis <lusopoemas@gmail.com>
 18:  * @version         $Id$
 19:  */
 20: 
 21: use Xoops\Core\Database\Connection;
 22: use Xoops\Core\Kernel\XoopsObject;
 23: use Xoops\Core\Kernel\XoopsPersistableObjectHandler;
 24: 
 25: /**
 26:  * A Config-Option
 27:  *
 28:  * @author    Kazumi Ono    <onokazu@xoops.org>
 29:  * @copyright    copyright (c) 2000-2003 XOOPS.org
 30:  *
 31:  * @package     kernel
 32:  */
 33: class UserconfigsOption extends XoopsObject
 34: {
 35:     /**
 36:      * Constructor
 37:      */
 38:     function __construct()
 39:     {
 40:         $this->initVar('confop_id', XOBJ_DTYPE_INT, null);
 41:         $this->initVar('confop_name', XOBJ_DTYPE_TXTBOX, null, true, 255);
 42:         $this->initVar('confop_value', XOBJ_DTYPE_TXTBOX, null, true, 255);
 43:         $this->initVar('conf_id', XOBJ_DTYPE_INT, 0);
 44:     }
 45: 
 46:     /**
 47:      * @param string $format
 48:      * @return mixed
 49:      */
 50:     public function id($format = 'n')
 51:     {
 52:         return $this->getVar('confop_id', $format);
 53:     }
 54: 
 55:     /**
 56:      * @param string $format
 57:      * @return mixed
 58:      */
 59:     public function confop_id($format = '')
 60:     {
 61:         return $this->getVar('confop_id', $format);
 62:     }
 63: 
 64:     /**
 65:      * @param string $format
 66:      * @return mixed
 67:      */
 68:     public function confop_name($format = '')
 69:     {
 70:         return $this->getVar('confop_name', $format);
 71:     }
 72: 
 73:     /**
 74:      * @param string $format
 75:      * @return mixed
 76:      */
 77:     public function confop_value($format = '')
 78:     {
 79:         return $this->getVar('confop_value', $format);
 80:     }
 81: 
 82:     /**
 83:      * @param string $format
 84:      * @return mixed
 85:      */
 86:     public function conf_id($format = '')
 87:     {
 88:         return $this->getVar('conf_id', $format);
 89:     }
 90: 
 91: }
 92: 
 93: class UserconfigsOptionHandler extends XoopsPersistableObjectHandler
 94: {
 95:     /**
 96:      * Constructor
 97:      *
 98:      * @param Connection|null $db {@link Connection}
 99:      */
100:     public function __construct(Connection $db = null)
101:     {
102:         parent::__construct($db, 'userconfigs_option', 'UserconfigsOption', 'confop_id', 'confop_name');
103:     }
104: }
105: