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