Class Organization
- TableAccess
- Organization
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:
Handle organization data of Admidio and is connected to database table adm_organizations
This class creates the organization object and manages the access to the organization specific preferences of the table adm_preferences. There are also some method to read the relationship of organizations if the database contains more then one organization.
Class: Organization
Code:
// create object and read the value of the language preference $organization = new Organization($gDb, $organizationId); $preferences = $organization->getPreferences(); $language = $preferences['system_language']; // language = 'de' @endcode
Par: Examples
Located at organization.php
Methods summary
public
|
#
__construct(
Constructor that will create an object of a recordset of the table adm_organizations. If the id is set than the specific organization will be loaded. |
public
|
|
public
integer
|
#
countAllRecords( )
Reads the number of all records of this table. In addition to the parent method this method will cache the value and will return the cached value on multiple calls. |
public
|
#
createBasicData( integer $userId )
Creates all necessary data for a new organization. This method can only be called once for an organization. It will create the basic categories, lists, roles, systemmails etc. |
public
string
|
#
getFamilySQL( boolean $shortname = false )
Create a comma separated list with all organization ids of children, parent and this organization that is prepared for use in SQL |
public
string[]
|
#
getOrganizationsInRelationship( boolean $child = true, boolean $parent = true, boolean $longname = false )
Read all child and parent organizations of this organization and returns an array with them. |
public
array
|
#
getPreferences( )
Reads all preferences of the current organization out of the database table adm_preferences. If the object has read the preferences than the method will return the stored values of the object. |
protected
string[]
|
|
public
boolean
|
|
public
boolean
|
#
isChildOrganization( integer $organizationId = 0 )
Method checks if the organization is configured as a child organization in the recordset. |
public
|
#
setPreferences( array $preferences, boolean $update = true )
Writes all preferences of the array @b $preferences in the database table @b adm_preferences. The method will only insert or update changed preferences. |
public
boolean
|
Methods inherited from TableAccess
__sleep()
,
connectAdditionalTable()
,
delete()
,
getValue()
,
hasColumnsValueChanged()
,
isNewRecord()
,
readData()
,
readDataByColumns()
,
readDataById()
,
save()
,
setArray()
,
setDatabase()
Properties summary
protected
boolean
|
$bCheckChildOrganizations
|
#
false
|
protected
array
|
$childOrganizations
|
#
array()
|
protected
array
|
$preferences
|
#
array()
|
protected
integer
|
$countOrganizations
|
#
0
|
Properties inherited from TableAccess
$additionalTables
,
$columnPrefix
,
$columnsInfos
,
$columnsValueChanged
,
$db
,
$dbColumns
,
$keyColumnName
,
$new_record
,
$tableName