1: <?php
2:
3: /**
4: * This file contains the nav main collection and item class.
5: *
6: * @package Core
7: * @subpackage GenericDB_Model
8: * @author Frederic Schneider
9: * @copyright four for business AG <www.4fb.de>
10: * @license http://www.contenido.org/license/LIZENZ.txt
11: * @link http://www.4fb.de
12: * @link http://www.contenido.org
13: */
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: /**
18: * File collection
19: *
20: * @package Core
21: * @subpackage GenericDB_Model
22: */
23: class cApiNavMainCollection extends ItemCollection {
24:
25: /**
26: * Constructor
27: */
28: public function __construct() {
29: global $cfg;
30: parent::__construct($cfg['tab']['nav_main'], 'idnavm');
31: $this->_setItemClass('cApiNavMain');
32: }
33:
34: /**
35: * Create new item with given values.
36: *
37: * @param string $location
38: * @return cApiNavMain
39: */
40: public function create($location) {
41: $item = $this->createNewItem();
42: $item->set('location', $location);
43: $item->store();
44: return $item;
45: }
46: }
47:
48: /**
49: * NavMain item
50: *
51: * @package Core
52: * @subpackage GenericDB_Model
53: */
54: class cApiNavMain extends Item {
55:
56: /**
57: * Constructor Function
58: *
59: * @param mixed $mId [optional]
60: * Specifies the ID of item to load
61: */
62: public function __construct($mId = false) {
63: global $cfg;
64: parent::__construct($cfg['tab']['nav_main'], 'idnavm');
65: $this->setFilters(array(
66: 'addslashes'
67: ), array(
68: 'stripslashes'
69: ));
70: if ($mId !== false) {
71: $this->loadByPrimaryKey($mId);
72: }
73: }
74: }
75: