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: namespace Xoops\Core\Kernel;
13:
14: /**
15: * abstract class object handler
16: *
17: * @category Xoops\Core\Kernel\XoopsModelAbstract
18: * @package Xoops\Core\Kernel
19: * @author Taiwen Jiang <phppp@users.sourceforge.net>
20: * @copyright 2000-2013 XOOPS Project (http://xoops.org)
21: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
22: * @link http://xoops.org
23: * @since 2.3.0
24: */
25: abstract class XoopsModelAbstract
26: {
27: /**
28: * holds referenced to handler object
29: *
30: * @var XoopsPersistableObjectHandler $handler
31: */
32: protected $handler;
33:
34: /**
35: * XoopsModelAbstract::setHandler()
36: *
37: * @param XoopsPersistableObjectHandler $handler handler to use
38: *
39: * @return boolean
40: */
41: public function setHandler(XoopsPersistableObjectHandler $handler)
42: {
43: $this->handler = $handler;
44: return true;
45: }
46:
47: /**
48: * XoopsModelAbstract::setVars()
49: *
50: * @param mixed $args args
51: *
52: * @return boolean
53: */
54: public function setVars($args)
55: {
56: if (!empty($args) && is_array($args)) {
57: foreach ($args as $key => $value) {
58: $this->$key = $value;
59: }
60: }
61: return true;
62: }
63: }
64: