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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  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 = $this->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.7 API documentation generated by ApiGen