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 cApiMetaTagCollection extends ItemCollection {
25:
26: 27: 28:
29: public function __construct() {
30: global $cfg;
31: parent::__construct($cfg['tab']['meta_tag'], 'idmetatag');
32: $this->_setItemClass('cApiMetaTag');
33:
34:
35: $this->_setJoinPartner('cApiArticleLanguageCollection');
36: $this->_setJoinPartner('cApiMetaTypeCollection');
37: }
38:
39: 40: 41: 42: 43: 44: 45: 46:
47: public function create($iIdArtLang, $iIdMetaType, $sMetaValue) {
48: $oItem = parent::createNewItem();
49:
50: $oItem->set('idartlang', (int) $iIdArtLang, false);
51: $oItem->set('idmetatype', (int) $iIdMetaType, false);
52: $oItem->set('metavalue', $this->escape($sMetaValue), false);
53: $oItem->store();
54:
55: return $oItem;
56: }
57:
58: 59: 60: 61: 62: 63: 64:
65: public function fetchByArtLangAndMetaType($iIdArtLang, $iIdMetaType) {
66: $this->select('idartlang=' . (int) $iIdArtLang . ' AND idmetatype=' . (int) $iIdMetaType);
67: return $this->next();
68: }
69:
70: }
71:
72: 73: 74: 75: 76: 77:
78: class cApiMetaTag extends Item {
79:
80: 81: 82: 83: 84:
85: public function __construct($mId = false) {
86: global $cfg;
87: parent::__construct($cfg['tab']['meta_tag'], 'idmetatag');
88: $this->setFilters(array(), array());
89: if ($mId !== false) {
90: $this->loadByPrimaryKey($mId);
91: }
92: }
93:
94: 95: 96: 97: 98: 99:
100: public function updateMetaValue($sMetaValue) {
101: $this->set('metavalue', $this->escape($sMetaValue), false);
102: return $this->store();
103: }
104:
105: }
106: