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
  • cApiSearchTracking
  • cApiSearchTrackingCollection
  • 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 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 = parent::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.3 API documentation generated by ApiGen 2.8.0