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
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  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:      * @TODO Should return null in case of failure
 42:      * @param int $idfrontendgroup specifies the frontend group
 43:      * @param int $idfrontenduser specifies the frontend user
 44:      * @return cApiFrontendGroupMember|false
 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 = $this->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.7 API documentation generated by ApiGen