Documentation

User_Profile_Attribute
in package

User Profile Attribute Object

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Thomas Daeppen thomas.daeppen@comvation.com

version
2.0.0
subpackage

lib_framework

used-by
User_Profile

Table of Contents

Properties

$EOF  : mixed
$coreLocalizationLoaded  : array<string|int, mixed>
Holds a list of language Ids of from which their localizations have been loaded so far.
$langInitPending  : bool
Used for determining the locale of the current request.
$readAccessGroupIds  : array<string|int, mixed>
Read Group access ids
$readAccessId  : int
Read Access id
$readProtected  : bool
Read protection status(1 or 0)
$access_group_ids  : mixed
$access_id  : mixed
$access_special  : mixed
$arrAttributeRelations  : mixed
$arrAttributes  : mixed
$arrAttributeTree  : mixed
$arrCoreAttributeIds  : mixed
$arrCoreAttributes  : mixed
$arrCustomAttributes  : mixed
$arrMandatoryAttributes  : mixed
$arrName  : mixed
$arrSortTypes  : mixed
$arrTypeAssociation  : mixed
$arrTypes  : mixed
$children  : mixed
$customized  : mixed
$defaultAttributeType  : mixed
$defaultSortType  : mixed
$errorMsg  : mixed
$id  : mixed
$langId  : mixed
$mandatory  : mixed
$modifiable  : mixed
$multiline  : mixed
$order_id  : mixed
$parent_id  : mixed
$protected  : mixed
$sort_type  : mixed
$type  : mixed

Methods

__construct()  : mixed
checkIntegrity()  : mixed
checkModifyPermission()  : mixed
checkReadPermission()  : bool
Check the read permission of profile attribute
clean()  : mixed
Clean attribute
createChild()  : mixed
delete()  : mixed
deleteAttribute()  : mixed
deleteAttributeContent()  : mixed
deleteAttributeEntity()  : mixed
deleteAttributeNames()  : mixed
first()  : mixed
Load first attribute
generateAttributeRelations()  : mixed
generateAttributeTree()  : mixed
getAccessId()  : mixed
getAttributeIdByName()  : int
get attribute id by attribut name
getAttributeNames()  : mixed
Load attribute name in each language
getById()  : mixed
getChildren()  : mixed
getCoreAttributeIds()  : mixed
getCustomAttributeIds()  : mixed
getCustomAttributeNameArray()  : array<string|int, mixed>
Returns an array of all custom attribute names in the selected language
getDataType()  : mixed
getErrorMsg()  : mixed
getHistoryAttributeId()  : mixed
getId()  : mixed
getLevel()  : mixed
getMandatoryAttributeIds()  : mixed
getMandatoryTypes()  : array<string|int, mixed>
Get an array containing all types that can be set to mandatory.
getMenuOptionValue()  : mixed
getName()  : string
Get the localized name (label) of this profile attribute.
getParent()  : mixed
getParentMenu()  : mixed
getParentType()  : mixed
getParentTypeDescription()  : mixed
getReadAccessId()  : int
Get read access ID
getSortableTypes()  : array<string|int, mixed>
Get an array containing all types that can be sorted.
getSortedAttributeIds()  : mixed
getSortType()  : mixed
getSortTypeDescription()  : mixed
getSortTypeMenu()  : mixed
getSpecialProtection()  : mixed
getTree()  : mixed
getType()  : string
Get element type of the attribute
getTypeDescription()  : mixed
getTypeMenu()  : mixed
hasChildOption()  : mixed
hasChildren()  : mixed
hasMandatoryOption()  : mixed
hasMovableOption()  : mixed
hasProtectionOption()  : mixed
hasSortableOption()  : mixed
init()  : mixed
isAllowedParentAttribute()  : mixed
isAllowedParentType()  : mixed
isChildrenModifiable()  : mixed
isCoreAttribute()  : mixed
isCustomAttribute()  : mixed
isHistoryChild()  : mixed
isMandatory()  : mixed
isModifiable()  : mixed
isMultiline()  : mixed
isNamesModifiable()  : mixed
isParentHistoryAttribute()  : mixed
isProtected()  : mixed
isReadProtected()  : bool
Return read protection status
isRemovable()  : mixed
isSortOrderModifiable()  : mixed
isSubChild()  : mixed
isTypeModifiable()  : mixed
isUnknownOption()  : mixed
load()  : mixed
Load attribute
loadCoreAttributeCountry()  : mixed
loadCoreAttributes()  : mixed
loadCoreAttributesCustomizing()  : mixed
loadCoreAttributeTitle()  : mixed
loadCustomAttributes()  : mixed
loadName()  : mixed
moveToEnd()  : mixed
Increase the order ID to move the attribute to the end
next()  : mixed
Load next attribute
removeProtection()  : mixed
removeReadProtection()  : mixed
Remove read protection
reset()  : mixed
setChildOrder()  : mixed
setMandatory()  : mixed
setMultiline()  : mixed
setNames()  : mixed
setParent()  : mixed
setProtection()  : mixed
setReadProtection()  : mixed
Set a read protection
setSortType()  : mixed
setSpecialProtection()  : mixed
setType()  : mixed
sortChildren()  : mixed
store()  : mixed
Store attribute to database
storeChildrenOrder()  : mixed
storeCoreAttribute()  : mixed
storeCoreAttributeTitle()  : mixed
storeCustomAttribute()  : mixed
storeNames()  : bool
Store attribute names
storeProtection()  : bool
Store read/write protection
initLangId()  : mixed
Tries to identify the locale of the current request
loadLocalizationOfCoreAttributes()  : mixed
Load labels/names of core profile attributes
hasSameParentHistoryAttribute()  : mixed

Properties

$coreLocalizationLoaded

Holds a list of language Ids of from which their localizations have been loaded so far.

protected array<string|int, mixed> $coreLocalizationLoaded = array()

$langInitPending

Used for determining the locale of the current request.

protected bool $langInitPending = \true

As long as the currect locale of the current request has not yet been identified, this property is kept to TRUE. As soon as the correct locale of the request has been identified, this property will be set to FALSE.

$arrCoreAttributes

private mixed $arrCoreAttributes = array( 'picture' => array('type' => 'image', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PROFILE_PIC', 'modifiable' => array('mandatory', 'access')), 'gender' => array('type' => 'menu', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'custom', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_GENDER', 'modifiable' => array('mandatory', 'access')), 'gender_undefined' => array('type' => 'menu_option', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 'gender', 'desc' => 'TXT_ACCESS_NOT_SPECIFIED', 'unknown' => \true, 'order_id' => 0), 'gender_female' => array('type' => 'menu_option', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 'gender', 'desc' => 'TXT_ACCESS_FEMALE', 'order_id' => 1), 'gender_male' => array('type' => 'menu_option', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 'gender', 'desc' => 'TXT_ACCESS_MALE', 'order_id' => 2), 'title' => array('type' => 'menu', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'desc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_TITLE', 'modifiable' => array('mandatory', 'sort_order', 'access', 'children')), 'title_undefined' => array('type' => 'menu_option', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 'title', 'desc' => 'TXT_ACCESS_NOT_SPECIFIED', 'value' => '0', 'unknown' => \true, 'order_id' => 0), 'designation' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_DESIGNATION', 'modifiable' => array('mandatory', 'access')), 'firstname' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_FIRSTNAME', 'modifiable' => array('mandatory', 'access')), 'lastname' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_LASTNAME', 'modifiable' => array('mandatory', 'access')), 'company' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_COMPANY', 'modifiable' => array('mandatory', 'access')), 'address' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_ADDRESS', 'modifiable' => array('mandatory', 'access')), 'zip' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_ZIP', 'modifiable' => array('mandatory', 'access')), 'city' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_CITY', 'modifiable' => array('mandatory', 'access')), 'country' => array( 'type' => 'menu', 'multiline' => \false, 'mandatory' => \false, // Countries are sorted in ascending order by their name. // However, as the list is loaded from library // \Cx\Core\Country\Controller\Country, we do set the sort behavior // to custom, as the returned list is already sorted 'sort_type' => 'custom', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_COUNTRY', 'modifiable' => array('mandatory', 'access'), ), 'country_undefined' => array('type' => 'menu_option', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 'country', 'desc' => 'TXT_ACCESS_NOT_SPECIFIED', 'value' => '0', 'unknown' => \true, 'order_id' => 0), 'phone_office' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PHONE_OFFICE', 'modifiable' => array('mandatory', 'access')), 'phone_private' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PHONE_PRIVATE', 'modifiable' => array('mandatory', 'access')), 'phone_mobile' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PHONE_MOBILE', 'modifiable' => array('mandatory', 'access')), 'phone_fax' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PHONE_FAX', 'modifiable' => array('mandatory', 'access')), 'birthday' => array('type' => 'date', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_BIRTHDAY', 'modifiable' => array('mandatory', 'access')), 'website' => array('type' => 'uri', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_WEBSITE', 'modifiable' => array('mandatory', 'access')), /*'skype' => array( 'type' => 'text', 'multiline' => false, 'mandatory' => false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_SKYPE_NAME', 'modifiable' => array('mandatory', 'access'), ),*/ 'profession' => array('type' => 'text', 'multiline' => \false, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_PREFESSION', 'modifiable' => array('mandatory', 'access')), 'interests' => array('type' => 'text', 'multiline' => \true, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_INTERESTS', 'modifiable' => array('mandatory', 'access')), 'signature' => array('type' => 'text', 'multiline' => \true, 'mandatory' => \false, 'sort_type' => 'asc', 'parent_id' => 0, 'desc' => 'TXT_ACCESS_SIGNATURE', 'modifiable' => array('mandatory', 'access')), )

$arrSortTypes

private mixed $arrSortTypes = array('asc' => 'TXT_ACCESS_ASCENDING', 'desc' => 'TXT_ACCESS_DESCENDING', 'custom' => 'TXT_ACCESS_CUSTOM')

$arrTypeAssociation

private mixed $arrTypeAssociation = array('' => array('text', 'mail', 'uri', 'date', 'image', 'checkbox', 'menu', 'group', 'history'), 'text' => array(), 'mail' => array(), 'uri' => array(), 'date' => array(), 'image' => array(), 'checkbox' => array(), 'menu' => array('menu_option'), 'group' => array('frame'), 'frame' => array('text', 'mail', 'uri', 'date', 'image', 'checkbox', 'menu', 'group', 'history'), 'history' => array('text', 'mail', 'uri', 'date', 'image', 'checkbox', 'menu', 'group', 'history'))

$arrTypes

private mixed $arrTypes = array('text' => array('desc' => 'TXT_ACCESS_TEXT_FIELD', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \true, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'string'), 'mail' => array('desc' => 'TXT_ACCESS_EMAIL_ADDRESS', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'string'), 'uri' => array('desc' => 'TXT_ACCESS_WEB_ADDRESS', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'string'), 'date' => array('desc' => 'TXT_ACCESS_DATE', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'int'), 'image' => array('desc' => 'TXT_ACCESS_IMAGE', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'string'), 'checkbox' => array('desc' => 'TXT_ACCESS_CHECKBOX', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \false, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'int'), 'menu' => array('desc' => 'TXT_ACCESS_MENU', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \true, 'children' => \true, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array('', 'menu_select_higher', 'menu_select_lower'), 'data_type' => 'int'), 'menu_option' => array('desc' => 'TXT_ACCESS_MENU_OPTION', 'parent' => 'TXT_ACCESS_MENU', 'mandatory' => \false, 'children' => \false, 'multiline' => \false, 'movable' => \false, 'protection' => \false, 'special' => array(), 'data_type' => 'null'), 'group' => array('desc' => 'TXT_ACCESS_GROUP', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \false, 'children' => \true, 'multiline' => \false, 'movable' => \true, 'protection' => \false, 'special' => array(), 'data_type' => 'array'), 'frame' => array('desc' => 'TXT_ACCESS_FRAME', 'parent' => 'TXT_ACCESS_GROUP', 'mandatory' => \false, 'children' => \true, 'multiline' => \false, 'movable' => \false, 'protection' => \false, 'special' => array(), 'data_type' => 'array'), 'history' => array('desc' => 'TXT_ACCESS_HISTORY', 'parent' => 'TXT_ACCESS_PARENT_ATTRIBUTE', 'mandatory' => \false, 'children' => \true, 'multiline' => \false, 'movable' => \true, 'protection' => \true, 'special' => array(), 'data_type' => 'array'))

Methods

checkModifyPermission()

public checkModifyPermission([mixed $currentValue = null ][, mixed $newValue = null ]) : mixed
Parameters
$currentValue : mixed = null
$newValue : mixed = null

checkReadPermission()

Check the read permission of profile attribute

public checkReadPermission() : bool
Return values
bool

getAttributeIdByName()

get attribute id by attribut name

public getAttributeIdByName(string $name) : int
Parameters
$name : string
Tags
global

$objDatabase

Return values
int

id or false if not found

getAttributeNames()

Load attribute name in each language

public getAttributeNames(mixed $id) : mixed
Parameters
$id : mixed
Return values
mixed

Array with names, which may also contains no elements, or FALSE on failure.

getCustomAttributeNameArray()

Returns an array of all custom attribute names in the selected language

public static getCustomAttributeNameArray([int $langId = 0 ]) : array<string|int, mixed>

If the $langId parameter is empty, the language is taken from the global LANG_ID constant. Used by Setting::show(), Shopmanager::view_settings_general()

Parameters
$langId : int = 0

The optional language ID

Tags
global

mixed $objDatabase Database connection object

static
author

Reto Kohli reto.kohli@comvation.com

Return values
array<string|int, mixed>

An array with attribute names indexed by their IDs on success, false otherwise

getMandatoryTypes()

Get an array containing all types that can be set to mandatory.

public getMandatoryTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

Get the localized name (label) of this profile attribute.

public getName([int $langId = null ]) : string

This method does ensure that the localization of the currently requested locale is loaded and returned. In case the currently requested locale (from the Cx-request) cannot be determined yet, then this method aborts and returns an empty string.

Parameters
$langId : int = null

ID of locale

Return values
string

getSortableTypes()

Get an array containing all types that can be sorted.

public getSortableTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSortedAttributeIds()

public getSortedAttributeIds([mixed $parentId = 0 ]) : mixed
Parameters
$parentId : mixed = 0

isAllowedParentAttribute()

public isAllowedParentAttribute(mixed $attributeId) : mixed
Parameters
$attributeId : mixed

isCoreAttribute()

public isCoreAttribute([mixed $attributeId = null ]) : mixed
Parameters
$attributeId : mixed = null

isCustomAttribute()

public isCustomAttribute([mixed $attributeId = null ]) : mixed
Parameters
$attributeId : mixed = null

isParentHistoryAttribute()

public isParentHistoryAttribute(mixed $attributeId) : mixed
Parameters
$attributeId : mixed

isUnknownOption()

public isUnknownOption([mixed $attributeId = null ]) : mixed
Parameters
$attributeId : mixed = null

setReadProtection()

Set a read protection

public setReadProtection(array<string|int, mixed> $arrReadGroups) : mixed
Parameters
$arrReadGroups : array<string|int, mixed>

array of Group id's

storeNames()

Store attribute names

public storeNames() : bool
Tags
global

ADONewConnection

Return values
bool

TRUE on success, otherwise FALSE

storeProtection()

Store read/write protection

public storeProtection(bool $protected, int $accessId, string $fieldName, array<string|int, mixed> $groupIds[, string $access = 'write' ]) : bool
Parameters
$protected : bool

Is read/write protected

$accessId : int

Access Id of read/write

$fieldName : string

Field name

$groupIds : array<string|int, mixed>

Assigned read/write group ids

$access : string = 'write'

Is read/write

Return values
bool

loadLocalizationOfCoreAttributes()

Load labels/names of core profile attributes

protected loadLocalizationOfCoreAttributes(int $langId) : mixed
Parameters
$langId : int

The Id of the language of which the localization shall be loaded.

Tags
global

array $_CORELANG Language data of core component

hasSameParentHistoryAttribute()

private hasSameParentHistoryAttribute(mixed $attributeId) : mixed
Parameters
$attributeId : mixed

        
On this page

Search results