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
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • 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
  • cApiArticleLanguageVersion
  • cApiArticleLanguageVersionCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiContentVersion
  • cApiContentVersionCollection
  • 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
  • cApiMetaTagVersion
  • cApiMetaTagVersionCollection
  • 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
  • cApiUserPasswordRequest
  • cApiUserPasswordRequestCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the group member collection and item class.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       GenericDB_Model
  8:  * @author           Dominik Ziegler
  9:  * @copyright        four for business AG <www.4fb.de>
 10:  * @license          http://www.contenido.org/license/LIZENZ.txt
 11:  * @link             http://www.4fb.de
 12:  * @link             http://www.contenido.org
 13:  */
 14: 
 15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: /**
 18:  * Group member collection
 19:  *
 20:  * @package Core
 21:  * @subpackage GenericDB_Model
 22:  */
 23: class cApiGroupMemberCollection extends ItemCollection {
 24:     /**
 25:      * Constructor to create an instance of this class.
 26:      *
 27:      * @throws cInvalidArgumentException
 28:      */
 29:     public function __construct() {
 30:         global $cfg;
 31:         parent::__construct($cfg['tab']['groupmembers'], 'idgroupuser');
 32:         $this->_setItemClass('cApiGroupMember');
 33: 
 34:         // set the join partners so that joins can be used via link() method
 35:         $this->_setJoinPartner('cApiGroupCollection');
 36:         $this->_setJoinPartner('cApiUserCollection');
 37:     }
 38: 
 39:     /**
 40:      * Creates a group member entry.
 41:      *
 42:      * @param string $userId
 43:      * @param string $groupId
 44:      *
 45:      * @return cApiGroupMember
 46:      * @throws cDbException
 47:      * @throws cException
 48:      * @throws cInvalidArgumentException
 49:      */
 50:     public function create($userId, $groupId) {
 51:         $oItem = $this->createNewItem();
 52: 
 53:         $oItem->set('user_id', $userId);
 54:         $oItem->set('group_id', $groupId);
 55: 
 56:         $oItem->store();
 57: 
 58:         return $oItem;
 59:     }
 60: 
 61:     /**
 62:      * Deletes group member entries by user id.
 63:      *
 64:      * @param string $userId
 65:      *
 66:      * @return bool
 67:      *
 68:      * @throws cDbException
 69:      * @throws cInvalidArgumentException
 70:      */
 71:     public function deleteByUserId($userId) {
 72:         $result = $this->deleteBy('user_id', $userId);
 73:         return ($result > 0) ? true : false;
 74:     }
 75: 
 76:     /**
 77:      * Fetches entry from table by user id and group id
 78:      *
 79:      * @param string $userId
 80:      * @param string $groupId
 81:      * 
 82:      * @return cApiGroupMember|NULL
 83:      * 
 84:      * @throws cDbException
 85:      * @throws cException
 86:      */
 87:     public function fetchByUserIdAndGroupId($userId, $groupId) {
 88:         $where = "user_id = '" . $this->escape($userId) . "' AND group_id = '" . $this->escape($groupId) . "'";
 89:         if ($this->select($where)) {
 90:             return $this->next();
 91:         } else {
 92:             return NULL;
 93:         }
 94:     }
 95: 
 96: }
 97: 
 98: /**
 99:  * Group member item
100:  *
101:  * @package Core
102:  * @subpackage GenericDB_Model
103:  */
104: class cApiGroupMember extends Item
105: {
106:     /**
107:      * Constructor to create an instance of this class.
108:      *
109:      * @param mixed $mId [optional]
110:      *                   Specifies the ID of item to load
111:      *
112:      * @throws cDbException
113:      * @throws cException
114:      */
115:     public function __construct($mId = false) {
116:         global $cfg;
117:         parent::__construct($cfg['tab']['groupmembers'], 'idgroupuser');
118:         $this->setFilters(array(), array());
119:         if ($mId !== false) {
120:             $this->loadByPrimaryKey($mId);
121:         }
122:     }
123: 
124: }
125: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0