Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • 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
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • 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
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the upload meta collection and item class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GenericDB_Model
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Dominik Ziegler
 10:  * @copyright four for business AG <www.4fb.de>
 11:  * @license http://www.contenido.org/license/LIZENZ.txt
 12:  * @link http://www.4fb.de
 13:  * @link http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * Upload meta collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiUploadMetaCollection extends ItemCollection {
 25: 
 26:     /**
 27:      * Create a new collection of items.
 28:      */
 29:     public function __construct() {
 30:         global $cfg;
 31:         parent::__construct($cfg['tab']['upl_meta'], 'id_uplmeta');
 32:         $this->_setItemClass('cApiUploadMeta');
 33: 
 34:         // set the join partners so that joins can be used via link() method
 35:         $this->_setJoinPartner('cApiUploadCollection');
 36:     }
 37: 
 38:     /**
 39:      * Creates a upload meta entry.
 40:      *
 41:      * @global object $auth
 42:      * @param int $idupl
 43:      * @param int $idlang
 44:      * @param string $medianame
 45:      * @param string $description
 46:      * @param string $keywords
 47:      * @param string $internal_notice
 48:      * @param string $copyright
 49:      * @param string $author
 50:      * @param string $created
 51:      * @param string $modified
 52:      * @param string $modifiedby
 53:      * @return cApiUploadMeta
 54:      */
 55:     public function create($idupl, $idlang, $medianame = '', $description = '', $keywords = '', $internal_notice = '', $copyright = '', $author = '', $created = '', $modified = '', $modifiedby = '') {
 56:         global $auth;
 57: 
 58:         if (empty($author)) {
 59:             $author = $auth->auth['uname'];
 60:         }
 61:         if (empty($created)) {
 62:             $created = date('Y-m-d H:i:s');
 63:         }
 64:         if (empty($modified)) {
 65:             $modified = date('Y-m-d H:i:s');
 66:         }
 67: 
 68:         $oItem = parent::createNewItem();
 69: 
 70:         $oItem->set('idupl', $idupl);
 71:         $oItem->set('idlang', $idlang);
 72:         $oItem->set('medianame', $medianame);
 73:         $oItem->set('description', $description);
 74:         $oItem->set('keywords', $keywords);
 75:         $oItem->set('internal_notice', $internal_notice);
 76:         $oItem->set('author', $author);
 77:         $oItem->set('created', $created);
 78:         $oItem->set('modified', $modified);
 79:         $oItem->set('modifiedby', $modifiedby);
 80:         $oItem->set('copyright', $copyright);
 81:         $oItem->store();
 82: 
 83:         return $oItem;
 84:     }
 85: }
 86: 
 87: /**
 88:  * Upload meta item
 89:  *
 90:  * @package Core
 91:  * @subpackage GenericDB_Model
 92:  */
 93: class cApiUploadMeta extends Item {
 94: 
 95:     /**
 96:      * Constructor Function
 97:      *
 98:      * @param mixed $mId Specifies the ID of item to load
 99:      */
100:     public function __construct($mId = false) {
101:         global $cfg;
102:         parent::__construct($cfg['tab']['upl_meta'], 'id_uplmeta');
103:         $this->setFilters(array(), array());
104:         if ($mId !== false) {
105:             $this->loadByPrimaryKey($mId);
106:         }
107:     }
108: 
109:     /**
110:      * Loads an upload meta entry by upload id and language id
111:      *
112:      * @param int $idupl
113:      * @param int $idlang
114:      * @return bool
115:      */
116:     public function loadByUploadIdAndLanguageId($idupl, $idlang) {
117:         $aProps = array(
118:             'idupl' => $idupl,
119:             'idlang' => $idlang
120:         );
121:         $aRecordSet = $this->_oCache->getItemByProperties($aProps);
122:         if ($aRecordSet) {
123:             // entry in cache found, load entry from cache
124:             $this->loadByRecordSet($aRecordSet);
125:             return true;
126:         } else {
127:             $where = $this->db->prepare('idupl = %d AND idlang = %d', $idupl, $idlang);
128:             return $this->_loadByWhereClause($where);
129:         }
130:     }
131: 
132:     /**
133:      * Userdefined setter for upload meta fields.
134:      *
135:      * @param string $name
136:      * @param mixed $value
137:      * @param bool $bSafe Flag to run defined inFilter on passed value
138:      * @todo should return return value of overloaded method
139:      */
140:     public function setField($name, $value, $bSafe = true) {
141:         switch ($name) {
142:             case 'idupl':
143:             case 'idlang':
144:                 $value = (int) $value;
145:                 break;
146:         }
147: 
148:         parent::setField($name, $value, $bSafe);
149:     }
150: }
151: 
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0