Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleLanguageVersion
  • cApiArticleLanguageVersionCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiContentVersion
  • cApiContentVersionCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaTagVersion
  • cApiMetaTagVersionCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiSearchTracking
  • cApiSearchTrackingCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserPasswordRequest
  • cApiUserPasswordRequestCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the meta tag collection and item class.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       GenericDB_Model
  8:  * @author           Murat Purc <murat@purc.de>
  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:  * Metatag collection
 19:  *
 20:  * @package Core
 21:  * @subpackage GenericDB_Model
 22:  */
 23: class cApiMetaTagCollection extends ItemCollection {
 24: 
 25:     /**
 26:      * Constructor to create an instance of this class.
 27:      */
 28:     public function __construct() {
 29:         global $cfg;
 30:         parent::__construct($cfg['tab']['meta_tag'], 'idmetatag');
 31:         $this->_setItemClass('cApiMetaTag');
 32: 
 33:         // set the join partners so that joins can be used via link() method
 34:         $this->_setJoinPartner('cApiArticleLanguageCollection');
 35:         $this->_setJoinPartner('cApiMetaTypeCollection');
 36:     }
 37: 
 38:     /**
 39:      * Creates a meta tag entry.
 40:      *
 41:      * @param int $iIdArtLang
 42:      * @param int $iIdMetaType
 43:      * @param string $sMetaValue
 44:      * @return cApiMetaTag
 45:      */
 46:     public function create($iIdArtLang, $iIdMetaType, $sMetaValue) {
 47:         $oItem = $this->createNewItem();
 48: 
 49:         $oItem->set('idartlang', $iIdArtLang, false);
 50:         $oItem->set('idmetatype', $iIdMetaType, false);
 51:         $oItem->set('metavalue', $sMetaValue, false);
 52:         $oItem->store();
 53: 
 54:         return $oItem;
 55:     }
 56: 
 57:     /**
 58:      * Returns a meta tag entry by article language and meta type.
 59:      *
 60:      * @param int $iIdArtLang
 61:      * @param int $iIdMetaType
 62:      * @return cApiMetaTag|NULL
 63:      */
 64:     public function fetchByArtLangAndMetaType($iIdArtLang, $iIdMetaType) {
 65:         $this->select('idartlang=' . (int) $iIdArtLang . ' AND idmetatype=' . (int) $iIdMetaType);
 66:         return $this->next();
 67:     }
 68: 
 69: }
 70: 
 71: /**
 72:  * Metatag item
 73:  *
 74:  * @package Core
 75:  * @subpackage GenericDB_Model
 76:  */
 77: class cApiMetaTag extends Item {
 78: 
 79:     /**
 80:      * Constructor to create an instance of this class.
 81:      *
 82:      * @param mixed $mId
 83:      *         Specifies the ID of item to load
 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:      * Updates meta value of an entry.
 96:      *
 97:      * @param string $sMetaValue
 98:      * @return bool
 99:      */
100:     public function updateMetaValue($sMetaValue) {
101:         $this->set('metavalue', $sMetaValue, false);
102:         return $this->store();
103:     }
104: 
105:     /**
106:      * Userdefined setter for meta tag fields.
107:      *
108:      * @param string $name
109:      * @param mixed $value
110:      * @param bool $bSafe [optional]
111:      *         Flag to run defined inFilter on passed value
112:      * @return bool
113:      */
114:     public function setField($name, $value, $bSafe = true) {
115:         switch ($name) {
116:             case 'idartlang':
117:                 $value = (int) $value;
118:                 break;
119:             case 'idmetatype':
120:                 $value = (int) $value;
121:                 break;
122:         }
123: 
124:         return parent::setField($name, $value, $bSafe);
125:     }
126: 
127:     /**
128:      * Creates a new, editable Version with same properties
129:      *
130:      * @param string $version
131:      */
132:     public function markAsEditable($version) {
133:         //var_export($this->values);
134:         //$parameters = $this->values;
135:         //$parameters['version'] = $version;
136:         $metaTagVersionColl = new cApiMetaTagVersionCollection();
137:         $metaTagVersionColl->create(
138:             $this->getField('idmetatag'),
139:             $this->getField('idartlang'),
140:             $this->getField('idmetatype'),
141:             $this->getField('metavalue'),
142:             $version
143:         );
144: 
145:     }
146: 
147: }
148: 
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0