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 container collection and item class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GenericDB_Model
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Timo Hummel
 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:  * Container collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiContainerCollection extends ItemCollection {
 25: 
 26:     /**
 27:      * Create a new collection of items.
 28:      *
 29:      * @param string $select where clause to use for selection (see
 30:      *        ItemCollection::select())
 31:      */
 32:     public function __construct($select = false) {
 33:         global $cfg;
 34:         parent::__construct($cfg['tab']['container'], 'idcontainer');
 35:         $this->_setItemClass('cApiContainer');
 36: 
 37:         // set the join partners so that joins can be used via link() method
 38:         $this->_setJoinPartner('cApiTemplateCollection');
 39: 
 40:         if ($select !== false) {
 41:             $this->select($select);
 42:         }
 43:     }
 44: 
 45:     /**
 46:      * Creates a container item entry
 47:      *
 48:      * @param int $idtpl
 49:      * @param int $number
 50:      * @param int $idmod
 51:      * @return cApiContainer
 52:      */
 53:     public function create($idtpl, $number, $idmod) {
 54:         $item = $this->createNewItem();
 55: 
 56:         $item->set('idtpl', $idtpl);
 57:         $item->set('number', $number);
 58:         $item->set('idmod', $idmod);
 59:         $item->store();
 60: 
 61:         return $item;
 62:     }
 63: 
 64:     /**
 65:      * Returns list of container numbers by passed template id.
 66:      *
 67:      * @param int $idtpl
 68:      * @return array
 69:      */
 70:     public function getNumbersByTemplate($idtpl) {
 71:         $list = array();
 72:         $sql = "SELECT number FROM `%s` WHERE idtpl = %d";
 73:         $this->db->query($sql, $this->table, $idtpl);
 74:         while ($this->db->nextRecord()) {
 75:             $list[] = $this->db->f('number');
 76:         }
 77:         return $list;
 78:     }
 79: 
 80:     /**
 81:      * Deletes all configurations by given template id
 82:      * @param int $idtpl
 83:      */
 84:     public function clearAssignments($idtpl) {
 85:         $this->deleteBy('idtpl', (int) $idtpl);
 86:     }
 87: 
 88:     /**
 89:      *
 90:      * @param int $idtpl
 91:      * @param int $number
 92:      * @param int $idmod
 93:      */
 94:     public function assignModule($idtpl, $number, $idmod) {
 95:         $this->select('idtpl = ' . (int) $idtpl . ' AND number = ' . (int) $number);
 96:         if (($item = $this->next()) !== false) {
 97:             $item->set('idmod', $idmod);
 98:             $item->store();
 99:         } else {
100:             $this->create($idtpl, $number, $idmod);
101:         }
102:     }
103: 
104:     /**
105:      * @deprecated [2013-10-12] Use assignModule instead
106:      */
107:     public function assignModul($idtpl, $number, $idmod) {
108:         cDeprecated("The method assignModul() is deprecated. Use assignModule() instead.");
109:         $this->assignModule($idtpl, $number, $idmod);
110:     }
111: }
112: 
113: /**
114:  * Container item
115:  *
116:  * @package Core
117:  * @subpackage GenericDB_Model
118:  */
119: class cApiContainer extends Item {
120: 
121:     /**
122:      * Constructor Function
123:      *
124:      * @param mixed $mId Specifies the ID of item to load
125:      */
126:     public function __construct($mId = false) {
127:         global $cfg;
128:         parent::__construct($cfg['tab']['container'], 'idcontainer');
129:         $this->setFilters(array(), array());
130:         if ($mId !== false) {
131:             $this->loadByPrimaryKey($mId);
132:         }
133:     }
134: 
135:     /**
136:      * Userdefined setter for container fields.
137:      *
138:      * @param string $name
139:      * @param mixed $value
140:      * @param bool $bSafe Flag to run defined inFilter on passed value
141:      * @todo should return return value of overloaded method
142:      */
143:     public function setField($name, $value, $bSafe = true) {
144:         switch ($name) {
145:             case 'idtpl':
146:             case 'number':
147:             case 'idmod':
148:                 $value = (int) $value;
149:                 break;
150:         }
151: 
152:         parent::setField($name, $value, $bSafe);
153:     }
154: 
155: }
156: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen