Class waContactFields
Static class to manage contact fields
Copyright: 2011 Webasyst LLC
License: LGPL
Author: Webasyst LLC
Located at wa-system/contact/waContactFields.class.php
public static
|
|
public static
|
|
protected static
array
|
#
merge_maintaining_order( mixed $a, mixed $b )
Merge two arrays (possibly containing same keys) so that the resulting array contains key => value from each of them in order of appearance in original array. If it is not possible, then no guarantee about resulting key order is made. |
public static
array
|
#
getAll( string $contactType = 'person', boolean $all = false )
Return array of field objects by type: person: all person fields (default); contact: all company fields; person_disabled: existing custom and system fields disabled for person contacts; company_disabled: existing custom and system fields disabled for company contacts. enabled: all fields currently active either for company or for person; if a field is active for both then only a person instance returned all: all fields; first enabled for person, then enabled for company, then rest. |
public static
array
|
|
public static
|
#
createField(
Add a new field to custom_fields.php if its id is unique (throws waException otherwise) |
public static
|
|
public static
|
#
updateField(
Update existing field without affecting *_fields_order.php or add it to custom fields if not exists yet. |
public static
|
#
enableField( mixed $field, mixed $type, mixed $position = null )
Add an existing field to person or company order list at a given position. If field already exists for this contact type then update its data and position. |
public static
|
#
disableField( mixed $id, mixed $type, boolean $delete = false )
Remove given field from person or company order list. |
public static
mixed
|
|
protected static
array
|
#
getCustomParameters(
Get field parameters to be saved in *_fields_order.php |
protected static
|
#
resetCustomParameters(
Reset field parameters that are normally saved in *_fields_order.php to prepare $field object to be saved in *fields.php |
protected static
mixed
|
#
ensureStaticVars( )
Load self::$personFields, self::$companyFields, self::$fieldStatus if not loaded yet |
protected static
array
|
$personFields |
|
#
Fields for 'person' contact type id => waContactField |
protected static
array
|
$companyFields |
|
#
Fields for 'company' contact type id => waContactField |
protected static
array
|
$personDisabled |
|
#
Fields not used for person contact type (system and custom). $companyDisabled and $personDisabled share the same object instances. Don't spoil them, clone if needed. id => waContactField |
protected static
array
|
$companyDisabled |
|
#
Fields not used for company contact type (system and custom). $companyDisabled and $personDisabled share the same object instances. Don't spoil them, clone if needed. id => waContactField |
protected static
array
|
$fieldStatus |
|
#
id => boolean: true for system fields, false for custom ones |
public static
array
|
$customParameters | array(
'allow_self_edit' => false,
'required' => false,
'unique' => false,
) |
#
Field parameters to store in *_fields_order.php id => default value to store in *fields.php |
protected static
array
|
$storages |
|
#
List of storages, cache for self::getStorage() id => waContactStorage |