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: public function create($keyword, $exp = '', $auto, $self = '', $idlang) {
36: $item = parent::createNewItem();
37:
38: $keyword = cSecurity::escapeString($keyword);
39: $exp = cSecurity::escapeString($exp);
40: $auto = cSecurity::escapeString($auto);
41: $self = cSecurity::escapeString($self);
42: $idlang = cSecurity::toInteger($idlang);
43:
44: $item->set('keyword', $keyword);
45: $item->set('exp', $exp);
46: $item->set('auto', $auto);
47: $item->set('self', $self);
48: $item->set('idlang', $idlang);
49:
50: $item->store();
51:
52: return ($item);
53: }
54:
55: }
56:
57: 58: 59: 60: 61: 62:
63: class cApiKeyword extends Item {
64:
65: 66: 67: 68: 69:
70: public function __construct($mId = false) {
71: global $cfg;
72: parent::__construct($cfg['tab']['keyword'], 'idkeyword');
73: $this->setFilters(array(
74: 'addslashes'
75: ), array(
76: 'stripslashes'
77: ));
78: if ($mId !== false) {
79: $this->loadByPrimaryKey($mId);
80: }
81: }
82:
83: }
84: