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 cApiActionlogCollection extends ItemCollection {
25:
26: 27: 28:
29: public function __construct() {
30: global $cfg;
31: parent::__construct($cfg['tab']['actionlog'], 'idlog');
32: $this->_setItemClass('cApiActionlog');
33:
34:
35: $this->_setJoinPartner('cApiUserCollection');
36: $this->_setJoinPartner('cApiClientCollection');
37: $this->_setJoinPartner('cApiLanguageCollection');
38: $this->_setJoinPartner('cApiActionCollection');
39: $this->_setJoinPartner('cApiCategoryArticleCollection');
40: }
41:
42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53:
54: public function create($userId, $idclient, $idlang, $idaction, $idcatart, $logtimestamp = '') {
55: $item = parent::createNewItem();
56:
57: if (empty($logtimestamp)) {
58: $logtimestamp = date('Y-m-d H:i:s');
59: }
60:
61: $item->set('user_id', $this->escape($userId));
62: $item->set('idclient', (int)$idclient);
63: $item->set('idlang', (int)$idlang);
64: $item->set('idaction', (int)$idaction);
65: $item->set('idcatart', (int)$idcatart);
66: $item->set('logtimestamp', $this->escape($logtimestamp));
67:
68: $item->store();
69:
70: return $item;
71: }
72:
73: }
74:
75: 76: 77: 78: 79: 80:
81: class cApiActionlog extends Item {
82:
83: 84: 85: 86: 87:
88: public function __construct($mId = false) {
89: global $cfg;
90: parent::__construct($cfg['tab']['actionlog'], 'idlog');
91: $this->setFilters(array(), array());
92: if ($mId !== false) {
93: $this->loadByPrimaryKey($mId);
94: }
95: }
96: }
97: