Class: ConsumerHelper

Source Location: /CORE/system/classes/consumer/ConsumerHelper.php

Class ConsumerHelper

Class Overview

This class provides extended methods for manipulating Consumer Settings.

Located in /CORE/system/classes/consumer/ConsumerHelper.php [line 41]

ConsumerService
   |
   --ConsumerHelper
Author(s):
  • Kevin Papst
Information Tags:
Version:  $Id: ConsumerHelper.php,v 1.16 2008/07/15 14:27:21 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From ConsumerService

ConsumerService::getConfigForDomain()
Finds the Consumer Config for the given Domain.
ConsumerService::getConsumerByName()
Fetches a full configured Consumer for the given Domain or null if no Consumer could be found for this URL.
ConsumerService::getConsumerConfigEntry()
Returns the Consumer Config Entry for the given Domain.
ConsumerService::getConsumerIdForDomain()
Returns the Consumer ID for a Domain Name.
ConsumerService::getNamesForID()
Gets all Domain names matching the given Consumer ID.
ConsumerService::loadConsumerConfiguration()
Returns the complete Consumer Configuration for this System, including ALL settings for ALL Consumer.
ConsumerService::_expireCache()

[ Top ]
Method Summary
void   activateConsumer()   Activates all Consumer Mappings for the given Consumer ID.
boolean   addConsumerConfig()   Sets an Array of Consumer Config Entrys and saves it afterwards.
void   deactivateConsumer()   Deactivates all Consumer Mappings for the given Consumer ID.
boolean   duplicateConsumerValues()   Copies all Key-Value pairs from $domain to $newDomain.
void   getAllConsumer()   Get an associative Array with all existing Consumer.
array   getAllConsumerIDs()   Returns all currently existing Consumer IDs within the System.
array   getAllConsumerNames()   Returns all currently existing Consumer Names within the System.
Consumer   getConsumerByID()   Returns an Consumer by its ID. If the Consumer does not exist it returns null.
void   getDefaultConsumer()  
boolean   isConsumerExisting()   This function checks if there is a Consumer existing wihtin the System.
boolean   removeConsumerByDomain()   Removes a complete Consumer from the Configuration.
boolean   removeConsumerByID()   Removes a complete Consumer from the Configuration.
void   removeDefaultConsumer()  
void   setConsumerValues()   Sets the Key-Value pair for all Consumers matching the given CID.
void   setDefaultConsumer()   This function sets the given Community as Default.

[ Top ]
Methods
activateConsumer  [line 95]

  void activateConsumer( $cid  )

Activates all Consumer Mappings for the given Consumer ID.

Parameters:
   $cid: 


[ Top ]
addConsumerConfig  [line 77]

  boolean addConsumerConfig( String $domain, Array $values  )

Sets an Array of Consumer Config Entrys and saves it afterwards.

Returns TRUE on success otherwise FALSE.

ATTENTION: Each entry that is empty will be removed! If you want to remove one of the Consumer Config Entrys, simply use

  1. addConsumerConfig($domainarray('foo' => ''))
.

Parameters:
String   $domain:  the Domain Name
Array   $values:  the Values to set

API Tags:
Return:  TRUE on success, otherwise FALSE


[ Top ]
deactivateConsumer  [line 103]

  void deactivateConsumer( $cid  )

Deactivates all Consumer Mappings for the given Consumer ID.

Parameters:
   $cid: 


[ Top ]
duplicateConsumerValues  [line 130]

  boolean duplicateConsumerValues( $domain, $newDomain  )

Copies all Key-Value pairs from $domain to $newDomain.

Parameters:
   $domain: 
   $newDomain: 

API Tags:
Return:  true on success, otherwise false


[ Top ]
getAllConsumer  [line 245]

  void getAllConsumer( )

Get an associative Array with all existing Consumer.

Arrays key is Consumer ID and value the

.



[ Top ]
getAllConsumerIDs  [line 192]

  array getAllConsumerIDs( )

Returns all currently existing Consumer IDs within the System.

If none is installed an empty array is returned!


API Tags:
Return:  all IDs as array


[ Top ]
getAllConsumerNames  [line 219]

  array getAllConsumerNames( )

Returns all currently existing Consumer Names within the System.

If none is installed an empty array is returned!


API Tags:
Return:  all Consumer Names as array


[ Top ]
getConsumerByID  [line 265]

  Consumer getConsumerByID( $id  )

Returns an Consumer by its ID. If the Consumer does not exist it returns null.

Parameters:
   $id: 

API Tags:
Return:  the Consumer or null


[ Top ]
getDefaultConsumer  [line 55]

  void getDefaultConsumer( )


API Tags:
See:  getConsumerByName(DEFAULT_COMMUNITY)


[ Top ]
isConsumerExisting  [line 208]

  boolean isConsumerExisting( )

This function checks if there is a Consumer existing wihtin the System.


API Tags:
Return:  TRUE if there is at least one Consumer, otherwise FALSE


[ Top ]
removeConsumerByDomain  [line 173]

  boolean removeConsumerByDomain( Stringt $name  )

Removes a complete Consumer from the Configuration.

You have to submit the Domain Name!

Parameters:
Stringt   $name:  the Consumers Domain to remove

API Tags:
Return:  TRUE on success, otherwise FALSE


[ Top ]
removeConsumerByID  [line 148]

  boolean removeConsumerByID( int $cid  )

Removes a complete Consumer from the Configuration.

You have to submit a Consumer ID!

Parameters:
int   $cid:  the Consumer ID

API Tags:
Return:  TRUE on success, otherwise FALSE


[ Top ]
removeDefaultConsumer  [line 60]

  void removeDefaultConsumer( )



[ Top ]
setConsumerValues  [line 111]

  void setConsumerValues( $cid, $newKey, $value  )

Sets the Key-Value pair for all Consumers matching the given CID.

Parameters:
   $cid: 
   $newKey: 
   $value: 


[ Top ]
setDefaultConsumer  [line 47]

  void setDefaultConsumer( $domain  )

This function sets the given Community as Default.

Parameters:
   $domain: 


[ Top ]