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 upload meta collection and item class.
  5:  *
  6:  * @package Core
  7:  * @subpackage GenericDB_Model
  8:  * @author Dominik Ziegler
  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:  * Upload meta collection
 19:  *
 20:  * @package Core
 21:  * @subpackage GenericDB_Model
 22:  */
 23: class cApiUploadMetaCollection 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']['upl_meta'], 'id_uplmeta');
 31:         $this->_setItemClass('cApiUploadMeta');
 32: 
 33:         // set the join partners so that joins can be used via link() method
 34:         $this->_setJoinPartner('cApiUploadCollection');
 35:     }
 36: 
 37:     /**
 38:      * Creates a upload meta entry.
 39:      *
 40:      * @global object $auth
 41:      * @param int $idupl
 42:      * @param int $idlang
 43:      * @param string $medianame [optional]
 44:      * @param string $description [optional]
 45:      * @param string $keywords [optional]
 46:      * @param string $internal_notice [optional]
 47:      * @param string $copyright [optional]
 48:      * @param string $author [optional]
 49:      * @param string $created [optional]
 50:      * @param string $modified [optional]
 51:      * @param string $modifiedby [optional]
 52:      * @return cApiUploadMeta
 53:      */
 54:     public function create($idupl, $idlang, $medianame = '', $description = '',
 55:             $keywords = '', $internal_notice = '', $copyright = '', $author = '',
 56:             $created = '', $modified = '', $modifiedby = '') {
 57:         global $auth;
 58: 
 59:         if (empty($author)) {
 60:             $author = $auth->auth['uname'];
 61:         }
 62:         if (empty($created)) {
 63:             $created = date('Y-m-d H:i:s');
 64:         }
 65:         if (empty($modified)) {
 66:             $modified = date('Y-m-d H:i:s');
 67:         }
 68: 
 69:         $oItem = $this->createNewItem();
 70: 
 71:         $oItem->set('idupl', $idupl);
 72:         $oItem->set('idlang', $idlang);
 73:         $oItem->set('medianame', $medianame);
 74:         $oItem->set('description', $description);
 75:         $oItem->set('keywords', $keywords);
 76:         $oItem->set('internal_notice', $internal_notice);
 77:         $oItem->set('author', $author);
 78:         $oItem->set('created', $created);
 79:         $oItem->set('modified', $modified);
 80:         $oItem->set('modifiedby', $modifiedby);
 81:         $oItem->set('copyright', $copyright);
 82:         $oItem->store();
 83: 
 84:         return $oItem;
 85:     }
 86: }
 87: 
 88: /**
 89:  * Upload meta item
 90:  *
 91:  * @package Core
 92:  * @subpackage GenericDB_Model
 93:  */
 94: class cApiUploadMeta extends Item {
 95: 
 96:     /**
 97:      * Constructor to create an instance of this class.
 98:      *
 99:      * @param mixed $mId [optional]
100:      *         Specifies the ID of item to load
101:      */
102:     public function __construct($mId = false) {
103:         global $cfg;
104:         parent::__construct($cfg['tab']['upl_meta'], 'id_uplmeta');
105:         $this->setFilters(array(), array());
106:         if ($mId !== false) {
107:             $this->loadByPrimaryKey($mId);
108:         }
109:     }
110: 
111:     /**
112:      * Loads an upload meta entry by upload id and language id
113:      *
114:      * @param int $idupl
115:      * @param int $idlang
116:      * @return bool
117:      */
118:     public function loadByUploadIdAndLanguageId($idupl, $idlang) {
119:         $aProps = array(
120:             'idupl' => $idupl,
121:             'idlang' => $idlang
122:         );
123:         $aRecordSet = $this->_oCache->getItemByProperties($aProps);
124:         if ($aRecordSet) {
125:             // entry in cache found, load entry from cache
126:             $this->loadByRecordSet($aRecordSet);
127:             return true;
128:         } else {
129:             $where = $this->db->prepare('idupl = %d AND idlang = %d', $idupl, $idlang);
130:             return $this->_loadByWhereClause($where);
131:         }
132:     }
133: 
134:     /**
135:      * Userdefined setter for upload meta fields.
136:      *
137:      * @param string $name
138:      * @param mixed $value
139:      * @param bool $bSafe [optional]
140:      *         Flag to run defined inFilter on passed value
141:      *
142:      * @return bool
143:      */
144:     public function setField($name, $value, $bSafe = true) {
145:         switch ($name) {
146:             case 'idupl':
147:             case 'idlang':
148:                 $value = (int) $value;
149:                 break;
150:         }
151: 
152:         return parent::setField($name, $value, $bSafe);
153:     }
154: }
155: 
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0