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 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:      * Deletes all configurations by given template id
 47:      * @param int $idtpl
 48:      */
 49:     public function clearAssignments($idtpl) {
 50:         $this->deleteBy('idtpl', (int) $idtpl);
 51:     }
 52: 
 53:     /**
 54:      *
 55:      * @param int $idtpl
 56:      * @param int $number
 57:      * @param int $idmod
 58:      */
 59:     public function assignModule($idtpl, $number, $idmod) {
 60:         $this->select('idtpl = ' . (int) $idtpl . ' AND number = ' . (int) $number);
 61:         if (($item = $this->next()) !== false) {
 62:             $item->set('idmod', $idmod);
 63:             $item->store();
 64:         } else {
 65:             $this->create($idtpl, $number, $idmod);
 66:         }
 67:     }
 68: 
 69:     /**
 70:      * @deprecated [2013-10-12] Use assignModule instead
 71:      */
 72:     public function assignModul($idtpl, $number, $idmod) {
 73:         cDeprecated("The method assignModul() is deprecated. Use assignModule() instead.");
 74:         $this->assignModule($idtpl, $number, $idmod);
 75:     }
 76: 
 77:     /**
 78:      * Creates a container item entry
 79:      *
 80:      * @param int $idtpl
 81:      * @param int $number
 82:      * @param int $idmod
 83:      * @return cApiContainer
 84:      */
 85:     public function create($idtpl, $number, $idmod) {
 86:         $item = parent::createNewItem();
 87: 
 88:         $item->set('idtpl', $idtpl);
 89:         $item->set('number', $number);
 90:         $item->set('idmod', $idmod);
 91:         $item->store();
 92: 
 93:         return $item;
 94:     }
 95: }
 96: 
 97: /**
 98:  * Container item
 99:  *
100:  * @package Core
101:  * @subpackage GenericDB_Model
102:  */
103: class cApiContainer extends Item {
104: 
105:     /**
106:      * Constructor Function
107:      *
108:      * @param mixed $mId Specifies the ID of item to load
109:      */
110:     public function __construct($mId = false) {
111:         global $cfg;
112:         parent::__construct($cfg['tab']['container'], 'idcontainer');
113:         $this->setFilters(array(), array());
114:         if ($mId !== false) {
115:             $this->loadByPrimaryKey($mId);
116:         }
117:     }
118: 
119:     /**
120:      * Userdefined setter for container fields.
121:      *
122:      * @param string $name
123:      * @param mixed $value
124:      * @param bool $bSafe Flag to run defined inFilter on passed value
125:      * @todo should return return value of overloaded method
126:      */
127:     public function setField($name, $value, $bSafe = true) {
128:         switch ($name) {
129:             case 'idtpl':
130:             case 'number':
131:             case 'idmod':
132:                 $value = (int) $value;
133:                 break;
134:         }
135: 
136:         parent::setField($name, $value, $bSafe);
137:     }
138: }
139: 
CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0