Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class Organization

TableAccess
Extended by Organization
Copyright: 2004-2016 The Admidio Team
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( Database & $database, integer|string $organization = '' )

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.

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.

Parameters

$database
Object of the class Database. This should be the default global object @b $gDb.
$organization

The recordset of the organization with this id will be loaded. The organization can be the table id or the organization shortname. If id isn't set than an empty object of the table is created.

Overrides

TableAccess::__construct
public
# clear( )

Initialize all necessary data of this object.

Initialize all necessary data of this object.

Overrides

TableAccess::clear
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.

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.

Returns

integer
Number of all organizations in database.

Overrides

TableAccess::countAllRecords
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.

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.

Parameters

$userId

The id of the administrator who creates the new organization. This will be the first valid user of the new organization.

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

Create a comma separated list with all organization ids of children, parent and this organization that is prepared for use in SQL

Parameters

$shortname
If set to true then a list of all shortnames will be returned

Returns

string

Returns a string with a comma separated list of all organization ids that are parents or children and the own id

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.

Read all child and parent organizations of this organization and returns an array with them.

Parameters

$child
If set to @b true (default) then all child organizations will be in the array
$parent
If set to @b true (default) then the parent organization will be in the array
$longname

If set to @b true then the value of the array will be the @b org_longname otherwise it will be @b org_shortname

Returns

string[]
Returns an array with all child and parent organizations e.g. array('org_id' => 'org_shortname')
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.

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.

Returns

array

Returns an array with all preferences of this organization. Array key is the column @b prf_name and array value is the column @b prf_value.

protected string[]
# getChildOrganizations( )

Returns

string[]
Returns an array with all child organizations
public boolean
# hasChildOrganizations( )

Method checks if this organization is the parent of other organizations.

Method checks if this organization is the parent of other organizations.

Returns

boolean
Return @b true if the organization has child organizations.
public boolean
# isChildOrganization( integer $organizationId = 0 )

Method checks if the organization is configured as a child organization in the recordset.

Method checks if the organization is configured as a child organization in the recordset.

Parameters

$organizationId

The @b org_shortname or @b org_id of the organization that should be set. If parameter isn't set than check the organization of this object.

Returns

boolean
Return @b true if the organization is a child of another organization
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.

Writes all preferences of the array @b $preferences in the database table @b adm_preferences. The method will only insert or update changed preferences.

Parameters

$preferences

Array with all preferences that should be stored in database. array('name_of_preference' => 'value')

$update
If set to @b false then no update will be done, only inserts
public boolean
# setValue( string $columnName, mixed $newValue, boolean $checkValue = true )

Set a new value for a column of the database table. The value is only saved in the object. You must call the method @b save to store the new value to the database

Set a new value for a column of the database table. The value is only saved in the object. You must call the method @b save to store the new value to the database

Parameters

$columnName
The name of the database column whose value should get a new value
$newValue
The new value that should be stored in the database field
$checkValue
The value will be checked if it's valid. If set to @b false than the value will not be checked.

Returns

boolean
Returns @b true if the value is stored in the current object and @b false if a check failed

Overrides

TableAccess::setValue

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

Admidio API API documentation generated by ApiGen