1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23:
24: class cApiKeywordCollection extends ItemCollection {
25:
26: 27: 28:
29: public function __construct() {
30: global $cfg;
31: parent::__construct($cfg['tab']['keyword'], 'idkeyword');
32: $this->_setItemClass('cApiKeyword');
33: }
34:
35: 36: 37: 38: 39: 40: 41: 42: 43:
44: public function create($keyword, $exp = '', $auto, $self = '', $idlang) {
45: $item = parent::createNewItem();
46:
47: $keyword = cSecurity::escapeString($keyword);
48: $exp = cSecurity::escapeString($exp);
49: $auto = cSecurity::escapeString($auto);
50: $self = cSecurity::escapeString($self);
51: $idlang = cSecurity::toInteger($idlang);
52:
53: $item->set('keyword', $keyword);
54: $item->set('exp', $exp);
55: $item->set('auto', $auto);
56: $item->set('self', $self);
57: $item->set('idlang', $idlang);
58:
59: $item->store();
60:
61: return ($item);
62: }
63:
64: }
65:
66: 67: 68: 69: 70: 71:
72: class cApiKeyword extends Item {
73:
74: 75: 76: 77: 78:
79: public function __construct($mId = false) {
80: global $cfg;
81: parent::__construct($cfg['tab']['keyword'], 'idkeyword');
82: $this->setFilters(array(
83: 'addslashes'
84: ), array(
85: 'stripslashes'
86: ));
87: if ($mId !== false) {
88: $this->loadByPrimaryKey($mId);
89: }
90: }
91:
92: }
93: