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 group member collection and item class.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       GenericDB_Model
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Dominik Ziegler
 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:  * Group member collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiGroupMemberCollection extends ItemCollection {
 25: 
 26:     public function __construct() {
 27:         global $cfg;
 28:         parent::__construct($cfg['tab']['groupmembers'], 'idgroupuser');
 29:         $this->_setItemClass('cApiGroupMember');
 30: 
 31:         // set the join partners so that joins can be used via link() method
 32:         $this->_setJoinPartner('cApiGroupCollection');
 33:         $this->_setJoinPartner('cApiUserCollection');
 34:     }
 35: 
 36:     /**
 37:      * Creates a group member entry.
 38:      *
 39:      * @param string $userId
 40:      * @param string $groupId
 41:      * @return cApiGroupMember
 42:      */
 43:     public function create($userId, $groupId) {
 44:         $oItem = parent::createNewItem();
 45: 
 46:         $oItem->set('user_id', $this->escape($userId));
 47:         $oItem->set('group_id', $this->escape($groupId));
 48: 
 49:         $oItem->store();
 50: 
 51:         return $oItem;
 52:     }
 53: 
 54:     /**
 55:      * Deletes group member entries by user id.
 56:      *
 57:      * @param string $userId
 58:      * @return bool
 59:      */
 60:     public function deleteByUserId($userId) {
 61:         $result = $this->deleteBy('user_id', $userId);
 62:         return ($result > 0)? true : false;
 63:     }
 64: 
 65:     /**
 66:      * Fetches entry from table by user id and group id
 67:      *
 68:      * @param string $userId
 69:      * @param string $groupId
 70:      * @return cApiGroupMember null
 71:      */
 72:     public function fetchByUserIdAndGroupId($userId, $groupId) {
 73:         $where = "user_id = '" . $this->escape($userId) . "' AND group_id = '" . $this->escape($groupId) . "'";
 74:         if ($this->select($where)) {
 75:             return $this->next();
 76:         } else {
 77:             return null;
 78:         }
 79:     }
 80: 
 81: }
 82: 
 83: /**
 84:  * Group member item
 85:  *
 86:  * @package Core
 87:  * @subpackage GenericDB_Model
 88:  */
 89: class cApiGroupMember extends Item {
 90: 
 91:     /**
 92:      * Constructor Function
 93:      *
 94:      * @param mixed $mId Specifies the ID of item to load
 95:      */
 96:     public function __construct($mId = false) {
 97:         global $cfg;
 98:         parent::__construct($cfg['tab']['groupmembers'], 'idgroupuser');
 99:         $this->setFilters(array(), array());
100:         if ($mId !== false) {
101:             $this->loadByPrimaryKey($mId);
102:         }
103:     }
104: 
105: }
106: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0