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 frontend group memeber collection and item class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GenericDB_Model
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Murat Purc <murat@purc.de>
 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:  * Frontend group member collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiFrontendGroupMemberCollection extends ItemCollection {
 25: 
 26:     /**
 27:      * Constructor Function
 28:      */
 29:     public function __construct() {
 30:         global $cfg;
 31:         parent::__construct($cfg['tab']['frontendgroupmembers'], 'idfrontendgroupmember');
 32:         $this->_setItemClass('cApiFrontendGroupMember');
 33: 
 34:         // set the join partners so that joins can be used via link() method
 35:         $this->_setJoinPartner('cApiFrontendGroupCollection');
 36:         $this->_setJoinPartner('cApiFrontendUserCollection');
 37:     }
 38: 
 39:     /**
 40:      * Creates a new association
 41:      *
 42:      * @param int $idfrontendgroup specifies the frontend group
 43:      * @param int $idfrontenduser specifies the frontend user
 44:      * @return cApiFrontendGroupMember bool
 45:      */
 46:     public function create($idfrontendgroup, $idfrontenduser) {
 47:         $this->select('idfrontendgroup = ' . (int) $idfrontendgroup . ' AND idfrontenduser = ' . (int) $idfrontenduser);
 48: 
 49:         if ($this->next()) {
 50:             return false;
 51:         }
 52: 
 53:         $item = parent::createNewItem();
 54: 
 55:         $item->set('idfrontenduser', $idfrontenduser);
 56:         $item->set('idfrontendgroup', $idfrontendgroup);
 57:         $item->store();
 58: 
 59:         return $item;
 60:     }
 61: 
 62:     /**
 63:      * Removes an association
 64:      *
 65:      * @param int $idfrontendgroup Specifies the frontend group
 66:      * @param int $idfrontenduser Specifies the frontend user
 67:      */
 68:     public function remove($idfrontendgroup, $idfrontenduser) {
 69:         $this->select('idfrontendgroup = ' . (int) $idfrontendgroup . ' AND idfrontenduser = ' . (int) $idfrontenduser);
 70: 
 71:         if (($item = $this->next()) !== false) {
 72:             $this->delete($item->get('idfrontendgroupmember'));
 73:         }
 74:     }
 75: 
 76:     /**
 77:      * Returns all users in a single group
 78:      *
 79:      * @param int $idfrontendgroup specifies the frontend group
 80:      * @param bool $asObjects Specifies if the function should return objects
 81:      * @return array List of frontend user ids or cApiFrontendUser items
 82:      */
 83:     public function getUsersInGroup($idfrontendgroup, $asObjects = true) {
 84:         $this->select('idfrontendgroup = ' . (int) $idfrontendgroup);
 85: 
 86:         $objects = array();
 87: 
 88:         while (($item = $this->next()) !== false) {
 89:             if ($asObjects) {
 90:                 $user = new cApiFrontendUser();
 91:                 $user->loadByPrimaryKey($item->get('idfrontenduser'));
 92:                 $objects[] = $user;
 93:             } else {
 94:                 $objects[] = $item->get('idfrontenduser');
 95:             }
 96:         }
 97: 
 98:         return ($objects);
 99:     }
100: }
101: 
102: /**
103:  * Frontend group member item
104:  *
105:  * @package Core
106:  * @subpackage GenericDB_Model
107:  */
108: class cApiFrontendGroupMember extends Item {
109: 
110:     /**
111:      * Constructor Function
112:      *
113:      * @param mixed $mId Specifies the ID of item to load
114:      */
115:     public function __construct($mId = false) {
116:         global $cfg;
117:         parent::__construct($cfg['tab']['frontendgroupmembers'], 'idfrontendgroupmember');
118:         if ($mId !== false) {
119:             $this->loadByPrimaryKey($mId);
120:         }
121:     }
122: }
123: 
CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0