CRM_Core_BAO_UFGroup
class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup
UF group BAO class.
Constants
NOT_NULL |
|
IS_NULL |
|
DB_DAO_NOTNULL |
|
VALUE_SEPARATOR |
|
BULK_INSERT_COUNT |
|
BULK_INSERT_HIGH_COUNT |
|
QUERY_FORMAT_WILDCARD |
|
QUERY_FORMAT_NO_QUOTES |
|
PUBLIC_VISIBILITY |
|
ADMIN_VISIBILITY |
|
LISTINGS_VISIBILITY |
|
Properties
static null | $_nullObject | from CRM_Core_DAO | |
static array | $_nullArray | from CRM_Core_DAO | |
static | $_dbColumnValueCache | from CRM_Core_DAO | |
static array | $_testEntitiesToSkip | Define entities that shouldn't be created or deleted when creating/ deleting test objects - this prevents world regions, countries etc from being added / deleted | from CRM_Core_DAO |
static object | $_factory | The factory class for this application. | from CRM_Core_DAO |
static | $_checkedSqlFunctionsExist | from CRM_Core_DAO | |
protected | $_options | https://issues.civicrm.org/jira/browse/CRM-17748 internal variable for DAO to hold per-query settings | from CRM_Core_DAO |
static string | $_tableName | Static instance to hold the table name. | from CRM_Core_DAO_UFGroup |
static boolean | $_log | Should CiviCRM log any modifications to this table in the civicrm_log table. | from CRM_Core_DAO_UFGroup |
int | $id | Unique table ID | from CRM_Core_DAO_UFGroup |
boolean | $is_active | Is this form currently active? If false, hide all related fields for all sharing contexts. | from CRM_Core_DAO_UFGroup |
string | $group_type | This column will store a comma separated list of the type(s) of profile fields. | from CRM_Core_DAO_UFGroup |
string | $title | Form title. | from CRM_Core_DAO_UFGroup |
text | $description | Optional verbose description of the profile. | from CRM_Core_DAO_UFGroup |
text | $help_pre | Description and/or help text to display before fields in form. | from CRM_Core_DAO_UFGroup |
text | $help_post | Description and/or help text to display after fields in form. | from CRM_Core_DAO_UFGroup |
int | $limit_listings_group_id | Group id, foreign key from civicrm_group | from CRM_Core_DAO_UFGroup |
string | $post_URL | Redirect to URL. | from CRM_Core_DAO_UFGroup |
int | $add_to_group_id | foreign key to civicrm_group_id | from CRM_Core_DAO_UFGroup |
boolean | $add_captcha | Should a CAPTCHA widget be included this Profile form. | from CRM_Core_DAO_UFGroup |
boolean | $is_map | Do we want to map results from this profile. | from CRM_Core_DAO_UFGroup |
boolean | $is_edit_link | Should edit link display in profile selector | from CRM_Core_DAO_UFGroup |
boolean | $is_uf_link | Should we display a link to the website profile in profile selector | from CRM_Core_DAO_UFGroup |
boolean | $is_update_dupe | Should we update the contact record if we find a duplicate | from CRM_Core_DAO_UFGroup |
string | $cancel_URL | Redirect to URL when Cancle button clik . | from CRM_Core_DAO_UFGroup |
boolean | $is_cms_user | Should we create a cms user for this profile | from CRM_Core_DAO_UFGroup |
text | $notify | from CRM_Core_DAO_UFGroup | |
boolean | $is_reserved | Is this group reserved for use by some other CiviCRM functionality? | from CRM_Core_DAO_UFGroup |
string | $name | Name of the UF group for directly addressing it in the codebase | from CRM_Core_DAO_UFGroup |
int | $created_id | FK to civicrm_contact, who created this UF group | from CRM_Core_DAO_UFGroup |
datetime | $created_date | Date and time this UF group was created. | from CRM_Core_DAO_UFGroup |
boolean | $is_proximity_search | Should we include proximity search feature in this profile search form? | from CRM_Core_DAO_UFGroup |
static string | $_matchFields | Cache the match clause used in this transaction. |
Methods
Generate and assign an arbitrary value to a field of a test object.
Execute a query by the current DAO, localizing it along the way (if needed).
Static function to set the factory instance for this class.
Factory method to instantiate a new object from a table name.
Initialization for all DAO objects. Since we access DB_DO programatically we need to set the links manually.
Returns foreign keys and entity references.
Deletes items from table which match current objects variables.
Given an associative array of name/value pairs, extract all the values that belong to this object and initialize the object with said values
Store all the values from this object in an associative array this is a destructive store, calling function is responsible for keeping sanity of id's.
Create an attribute for this specific field. We only do this for strings and text
Get the size and maxLength attributes for this text field.
Check if there is a record with the same name in the db.
Check if there is a given column in a specific table.
Scans all the tables using a slow query and table name.
Checks if a constraint exists for a specified table.
Checks if CONSTRAINT keyword exists for a specified table.
Checks if the FK constraint name is in the format 'FK_tableName_columnName' for a specified column of a table.
Check whether a specific column in a specific table has always the same value.
Check whether a specific column in a specific table is always NULL.
Check if there is a given table in the database.
Get all the result records as mapping between columns.
Given a DAO name, a column name and a column value, find the record and GET the value of another column in that record
Given a DAO name, a column name and a column value, find the record and SET the value of another column in that record
Get sort string.
Fetch object based on array of properties.
Delete the object records that are associated with this contact.
Execute an unbuffered query.
Execute a query.
Execute a query and get the single result.
Compose the query by merging the parameters into it.
make a shallow copy of an object.
Cascade update through related entities.
Given the component id, compute the contact id since its used for things like send email
Fetch object based on array of properties.
Escape a list of strings for use with "WHERE X IN (.
Creates a test object, including any required objects it needs via recursion createOnly: only create in database, do not store or return the objects (useful for perf testing) ONLY USE FOR TESTING
Deletes the this object plus any dependent objects that are associated with it.
Set defaults when creating new entity.
No description
No description
Build a list of triggers via hook and add them to (err, reconcile them with) the database.
Because sql functions are sometimes lost, esp during db migration, we check here to avoid numerous support requests
Given a list of fields, create a list of references.
List all tables which have hard foreign keys to this table.
Lookup the value of a MySQL global configuration variable.
Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields.
Get options for the called BAO object's field.
Provides documentation and validation for the buildOptions $context param
Get SQL where clause for SQL filter syntax input parameters.
SQL has a limit of 64 characters on various names: table name, trigger name, column name .
https://issues.civicrm.org/jira/browse/CRM-17748 Sets the internal options to be used on a query
https://issues.civicrm.org/jira/browse/CRM-17748 wrapper to pass internal DAO options down to DB_mysql/DB_Common level
Generates acl clauses suitable for adding to WHERE or ON when doing an api.get for this entity
This returns the final permissioned query string for this entity
ensure database name is 'safe', i.e. only contains word characters (includes underscores) and dashes, and contains at least one [a-z] case insenstive.
Return a mapping from field-name to the corresponding key (as used in fields()).
Returns the list of fields that can be imported
Returns the list of fields that can be exported
Fetch object based on array of properties.
Retrieve the first non-generic contact type
Get the form title.
Update the is_active flag in the db.
Get all the registration fields.
Get all the listing fields.
Get all the fields that belong to the group with the name title, and format for use with buildProfile. This is the SQL analog of formatUFFields().
Format a list of UFFields for use with buildProfile. This is the in-memory analog of getFields().
Prepare a field for rendering with CRM_Core_BAO_UFGroup::buildProfile.
Create a query to find all visible UFFields in a UFGroup.
Create a query to find all visible UFFields in a UFGroup.
Get a list of filtered field metadata.
Get the metadata for all potential profile fields.
Get the fields relating to locations.
No description
Check the data validity.
Get the html for the form that represents this particular group.
Given a contact id and a field set, return the values from the db.
Check if profile Group used by any module.
Delete the profile Group.
Add the UF Group.
Make uf join entries for an uf group.
Get the UF Join records for an ufgroup id.
Function takes an associative array and creates a ufjoin record for ufgroup.
Delete the uf join record for an uf group.
Get the weight for ufjoin record.
Get the uf group for a module.
Filter ufgroups based on logged in user contact type.
Add profile field to a form.
Set profile defaults.
Get profiles by type eg: pure Individual etc
Check whether a profile is valid combination of required and/or optional profile types
Check whether a profile is valid combination of required profile fields
Get default value for Register.
make a copy of a profile, including all the fields in the profile
Process that send notification e-mails
Given a contact id and a group id, returns the field values from the db for this group and notify email only if group's notify field is set and field values are not empty
Format fields for dupe Contact Matching.
Calculate the profile type 'group_type' as per profile fields.
Calculate the profile type 'group_type' as per profile fields.
Update the profile type 'group_type' as per profile fields including group types and group subtype values.
Create a "group_type" string.
setDefault componet specific profile fields.
No description
Retrieve groups of profiles.
Alter contact params by filtering existing subscribed groups and returns unsubscribed groups array for subscription.
Check if we are rendering mixed profiles.
Determine of we show overlay profile or not.
Get group type values of the profile.
No description
No description
Get profiles used for batch entry.
No description
This is function is used to format pseudo fields.
Details
in CRM_Core_DAO_UFGroup at line 193
CRM_Core_DAO
__construct()
Class constructor.
in CRM_Core_DAO_UFGroup at line 508
static
getTableName()
Returns the names of this table
in CRM_Core_DAO at line 112
static
init(string $dsn)
Initialize the DAO object.
in CRM_Core_DAO at line 131
static DB_common
getConnection()
in CRM_Core_DAO at line 142
protected
assignTestFK(string $fieldName, $fieldDef, array $params)
in CRM_Core_DAO at line 191
protected
assignTestValue(string $fieldName, array $fieldDef, int $counter)
Generate and assign an arbitrary value to a field of a test object.
in CRM_Core_DAO at line 303
reset()
Reset the DAO object.
DAO is kinda crappy in that there is an unwritten rule of one query per DAO.
We attempt to get around this crappy restriction by resetting some of DAO's internal fields. Use this with caution
in CRM_Core_DAO at line 323
static string
getLocaleTableName(string $tableName)
in CRM_Core_DAO at line 345
object
query(string $query, bool $i18nRewrite = TRUE)
Execute a query by the current DAO, localizing it along the way (if needed).
in CRM_Core_DAO at line 374
static
setFactory(object $factory)
Static function to set the factory instance for this class.
in CRM_Core_DAO at line 383
factory(string $table = '')
Factory method to instantiate a new object from a table name.
in CRM_Core_DAO at line 395
initialize()
Initialization for all DAO objects. Since we access DB_DO programatically we need to set the links manually.
in CRM_Core_DAO at line 411
array
keys()
Defines the default key as 'id'.
in CRM_Core_DAO at line 426
array
sequenceKey()
Tells DB_DataObject which keys use autoincrement.
'id' is autoincrementing by default.
in CRM_Core_DAO_UFGroup at line 203
static array
getReferenceColumns()
Returns foreign keys and entity references.
in CRM_Core_DAO_UFGroup at line 218
static array
fields()
Returns all the column names of this table
in CRM_Core_DAO at line 462
array
table()
Get/set an associative array of table columns
in CRM_Core_DAO at line 485
CRM_Core_DAO
save(bool $hook = TRUE)
Save DAO object.
in CRM_Core_DAO at line 536
delete(bool $useWhere = FALSE)
Deletes items from table which match current objects variables.
Returns the true on success
for example
Designed to be extended
$object = new mytable(); $object->ID=123; echo $object->delete(); // builds a conditon
$object = new mytable(); $object->whereAdd('age > 12'); $object->limit(1); $object->orderBy('age DESC'); $object->delete(true); // dont use object vars, use the conditions, limit and order.
in CRM_Core_DAO at line 552
log(bool $created = FALSE)
in CRM_Core_DAO at line 587
bool
copyValues(array $params)
Given an associative array of name/value pairs, extract all the values that belong to this object and initialize the object with said values
in CRM_Core_DAO at line 628
static
storeValues(object $object, array $values)
Store all the values from this object in an associative array this is a destructive store, calling function is responsible for keeping sanity of id's.
in CRM_Core_DAO at line 650
static array|null
makeAttribute(array $field)
Create an attribute for this specific field. We only do this for strings and text
in CRM_Core_DAO at line 703
static array
getAttribute(string $class, string $fieldName = NULL)
Get the size and maxLength attributes for this text field.
(or for all text fields) in the DAO object.
in CRM_Core_DAO at line 731
static
transaction($type)
in CRM_Core_DAO at line 754
static bool
objectExists(string $value, string $daoName, string $daoID, string $fieldName = 'name', string $domainID = NULL)
Check if there is a record with the same name in the db.
in CRM_Core_DAO at line 780
static bool
checkFieldExists(string $tableName, string $columnName, bool $i18nRewrite = TRUE)
Check if there is a given column in a specific table.
in CRM_Core_DAO at line 798
static array
getTableNames()
Scans all the tables using a slow query and table name.
in CRM_Core_DAO at line 820
static bool
isDBMyISAM(int $maxTablesToCheck = 10)
in CRM_Core_DAO at line 837
static string
getDatabaseName()
Get the name of the CiviCRM database.
in CRM_Core_DAO at line 851
static bool
checkConstraintExists(string $tableName, string $constraint)
Checks if a constraint exists for a specified table.
in CRM_Core_DAO at line 879
static bool
schemaRequiresRebuilding(array $tables = array("civicrm_contact"))
Checks if CONSTRAINT keyword exists for a specified table.
in CRM_Core_DAO at line 915
static bool
checkFKConstraintInFormat(string $tableName, string $columnName)
Checks if the FK constraint name is in the format 'FK_tableName_columnName' for a specified column of a table.
in CRM_Core_DAO at line 944
static bool
checkFieldHasAlwaysValue(string $tableName, string $columnName, string $columnValue)
Check whether a specific column in a specific table has always the same value.
in CRM_Core_DAO at line 961
static bool
checkFieldIsAlwaysNull(string $tableName, string $columnName)
Check whether a specific column in a specific table is always NULL.
in CRM_Core_DAO at line 977
static bool
checkTableExists(string $tableName)
Check if there is a given table in the database.
in CRM_Core_DAO at line 995
bool
checkVersion($version)
in CRM_Core_DAO at line 1013
static object
findById(int $id)
Find a DAO object for the given ID and return it.
in CRM_Core_DAO at line 1027
array
fetchAll()
Returns all results as array-encoded records.
in CRM_Core_DAO at line 1045
array
fetchMap(string $keyColumn, string $valueColumn)
Get all the result records as mapping between columns.
in CRM_Core_DAO at line 1070
static string|null
getFieldValue(string $daoName, int $searchValue, string $returnColumn = 'name', string $searchColumn = 'id', bool $force = FALSE)
Given a DAO name, a column name and a column value, find the record and GET the value of another column in that record
in CRM_Core_DAO at line 1120
static bool
setFieldValue(string $daoName, int $searchValue, string $setColumn, string $setValue, string $searchColumn = 'id')
Given a DAO name, a column name and a column value, find the record and SET the value of another column in that record
in CRM_Core_DAO at line 1146
static string
getSortString(array|object $sort, string $default = NULL)
Get sort string.
in CRM_Core_DAO at line 1177
static object
commonRetrieve(string $daoName, array $params, array $defaults, array $returnProperities = NULL)
Fetch object based on array of properties.
in CRM_Core_DAO at line 1202
static
deleteEntityContact(string $daoName, int $contactId)
Delete the object records that are associated with this contact.
in CRM_Core_DAO at line 1227
static CRM_Core_DAO
executeUnbufferedQuery(string $query, array $params = array(), bool $abort = TRUE, null $daoName = NULL, bool $freeDAO = FALSE, bool $i18nRewrite = TRUE, bool $trapException = FALSE)
Execute an unbuffered query.
This is a wrapper around new functionality exposed with CRM-17748.
in CRM_Core_DAO at line 1293
static CRM_Core_DAO|object
executeQuery(string $query, array $params = array(), bool $abort = TRUE, null $daoName = NULL, bool $freeDAO = FALSE, bool $i18nRewrite = TRUE, bool $trapException = FALSE)
Execute a query.
in CRM_Core_DAO at line 1343
static string|null
singleValueQuery(string $query, array $params = array(), bool $abort = TRUE, bool $i18nRewrite = TRUE)
Execute a query and get the single result.
in CRM_Core_DAO at line 1381
static string
composeQuery(string $query, array $params, bool $abort = TRUE)
Compose the query by merging the parameters into it.
in CRM_Core_DAO at line 1428
static
freeResult(null $ids = NULL)
in CRM_Core_DAO at line 1474
static CRM_Core_DAO
copyGeneric(string $daoName, array $criteria, array $newData = NULL, string $fieldsFix = NULL, string $blockCopyOfDependencies = NULL)
make a shallow copy of an object.
and all the fields in the object
in CRM_Core_DAO at line 1557
static CRM_Core_DAO|null
cascadeUpdate(string $daoName, $fromId, $toId, array $newData = array())
Cascade update through related entities.
in CRM_Core_DAO at line 1601
static array
getContactIDsFromComponent($componentIDs, string $tableName)
Given the component id, compute the contact id since its used for things like send email
in CRM_Core_DAO at line 1636
static object
commonRetrieveAll(string $daoName, string $fieldIdName = 'id', int $fieldId, $details, array $returnProperities = NULL)
Fetch object based on array of properties.
in CRM_Core_DAO at line 1658
static
dropAllTables()
in CRM_Core_DAO at line 1680
static string
escapeString($string)
in CRM_Core_DAO at line 1709
static string
escapeStrings(array $strings, string $default = NULL)
Escape a list of strings for use with "WHERE X IN (.
..)" queries.
in CRM_Core_DAO at line 1728
static string
escapeWildCardString($string)
in CRM_Core_DAO at line 1756
static object|array|NULL
createTestObject(string $daoName, array $params = array(), int $numObjects = 1, bool $createOnly = FALSE)
Creates a test object, including any required objects it needs via recursion createOnly: only create in database, do not store or return the objects (useful for perf testing) ONLY USE FOR TESTING
in CRM_Core_DAO at line 1839
static
deleteTestObjects(string $daoName, array $params = array())
Deletes the this object plus any dependent objects that are associated with it.
ONLY USE FOR TESTING
in CRM_Core_DAO at line 1885
static
setCreateDefaults(array $params, $defaults)
Set defaults when creating new entity.
(don't call this set defaults as already in use with different signature in some places)
in CRM_Core_DAO at line 1903
static string
createTempTableName(string $prefix = 'civicrm', bool $addRandomString = TRUE, null $string = NULL)
in CRM_Core_DAO at line 1923
static bool
checkTriggerViewPermission(bool $view = TRUE, bool $trigger = TRUE)
in CRM_Core_DAO at line 1971
static
debugPrint(null $message = NULL, bool $printDAO = TRUE)
in CRM_Core_DAO at line 1995
static
triggerRebuild(string $tableName = NULL, bool $force = FALSE)
deprecated
deprecated
Build a list of triggers via hook and add them to (err, reconcile them with) the database.
in CRM_Core_DAO at line 2006
static
checkSqlFunctionsExist()
Because sql functions are sometimes lost, esp during db migration, we check here to avoid numerous support requests
in CRM_Core_DAO at line 2023
static
dropTriggers(string $tableName = NULL)
deprecated
deprecated
Wrapper function to drop triggers.
in CRM_Core_DAO at line 2034
static
createTriggers(array $info, string $onlyTableName = NULL)
deprecated
deprecated
in CRM_Core_DAO at line 2045
static array
createReferenceColumns(string $className)
Given a list of fields, create a list of references.
in CRM_Core_DAO at line 2068
array
findReferences()
Find all records which refer to this entity.
in CRM_Core_DAO at line 2097
array
getReferenceCounts()
in CRM_Core_DAO at line 2134
static array
getReferencesToTable(string $tableName)
List all tables which have hard foreign keys to this table.
For now, this returns a description of every entity_id/entity_table reference. TODO: filter dynamic entity references on the $tableName, based on schema metadata in dynamicForeignKey which enumerates a restricted set of possible entity_table's.
in CRM_Core_DAO at line 2158
static mixed
getGlobalSetting(string $name, mixed $default = NULL)
Lookup the value of a MySQL global configuration variable.
in CRM_Core_DAO at line 2183
static protected
appendPseudoConstantsToFields(array $fields)
Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields.
This is relevant where we want to offer both the ID field and the label field as an option, e.g. search builder.
It is currently limited for optionGroupName for purposes keeping the scope of the change small, but is appropriate for other sorts of pseudoconstants.
in CRM_Core_DAO at line 2209
static array|bool
buildOptions(string $fieldName, string $context = NULL, array $props = array())
Get options for the called BAO object's field.
This function can be overridden by each BAO to add more logic related to context. The overriding function will generally call the lower-level CRM_Core_PseudoConstant::get
in CRM_Core_DAO at line 2220
getOptionLabels()
Populate option labels for this object's fields.
in CRM_Core_DAO at line 2246
static array
buildOptionsContext(string $context = NULL)
Provides documentation and validation for the buildOptions $context param
in CRM_Core_DAO at line 2266
bool|array
getFieldSpec(string $fieldName)
in CRM_Core_DAO at line 2309
static NULL|string|array
createSQLFilter(string $fieldName, array $filter, string $type = NULL, string $alias = NULL, bool $returnSanitisedArray = FALSE)
Get SQL where clause for SQL filter syntax input parameters.
SQL version of api function to assign filters to the DAO based on the syntax $field => array('IN' => array(4,6,9)) OR $field => array('LIKE' => array('%me%)) etc
in CRM_Core_DAO at line 2372
static array
acceptedSQLOperators()
in CRM_Core_DAO at line 2409
static string
shortenSQLName(string $string, int $length = 60, bool $makeRandom = FALSE)
SQL has a limit of 64 characters on various names: table name, trigger name, column name .
..
For custom groups and fields we generated names from user entered input which can be longer than this length, this function helps with creating strings that meet various criteria.
in CRM_Core_DAO at line 2435
setOptions(array $options)
https://issues.civicrm.org/jira/browse/CRM-17748 Sets the internal options to be used on a query
in CRM_Core_DAO at line 2448
protected
_setDBOptions(array $options)
https://issues.civicrm.org/jira/browse/CRM-17748 wrapper to pass internal DAO options down to DB_mysql/DB_Common level
in CRM_Core_DAO at line 2463
setApiFilter(array $params)
deprecated
deprecated
in CRM_Core_DAO at line 2480
array
addSelectWhereClause()
Generates acl clauses suitable for adding to WHERE or ON when doing an api.get for this entity
Return format is in the form of fieldname => clauses starting with an operator. e.g.:
in CRM_Core_DAO at line 2521
static array
getSelectWhereClause(string $tableAlias = NULL)
This returns the final permissioned query string for this entity
With acls from related entities + additional clauses from hook_civicrm_selectWhereClause
in CRM_Core_DAO at line 2544
static bool
requireSafeDBName($database)
ensure database name is 'safe', i.e. only contains word characters (includes underscores) and dashes, and contains at least one [a-z] case insenstive.
in CRM_Core_DAO_UFGroup at line 497
static array
fieldKeys()
Return a mapping from field-name to the corresponding key (as used in fields()).
in CRM_Core_DAO_UFGroup at line 516
boolean
getLog()
Returns if this table needs to be logged
in CRM_Core_DAO_UFGroup at line 526
static array
import(bool $prefix = false)
Returns the list of fields that can be imported
in CRM_Core_DAO_UFGroup at line 537
static array
export(bool $prefix = false)
Returns the list of fields that can be exported
in CRM_Core_DAO_UFGroup at line 544
static
indices($localize = TRUE)
Returns the list of indices
at line 60
static object
retrieve(array $params, array $defaults)
Fetch object based on array of properties.
at line 73
static string
getContactType(int $id)
Retrieve the first non-generic contact type
at line 107
static string
getTitle(int $id)
Get the form title.
at line 122
static Object
setIsActive(int $id, bool $is_active)
Update the is_active flag in the db.
at line 139
static array
getRegistrationFields(int $action, int $mode, null $ctype = NULL)
Get all the registration fields.
at line 200
static array
getListingFields(int $action, int $visibility, bool $considerSelector = FALSE, array $ufGroupIds = NULL, bool $searchable = NULL, null $restrict = NULL, bool $skipPermission = FALSE, int $permissionType = CRM_Core_Permission::SEARCH)
Get all the listing fields.
at line 282
static array
getFields(mix $id, bool|int $register = FALSE, int $action = NULL, int $visibility = NULL, $searchable = NULL, bool $showAll = FALSE, string $restrict = NULL, bool $skipPermission = FALSE, null $ctype = NULL, int $permissionType = CRM_Core_Permission::CREATE, string $orderBy = 'field_name', null $orderProfiles = NULL, bool $eventProfile = FALSE)
Get all the fields that belong to the group with the name title, and format for use with buildProfile. This is the SQL analog of formatUFFields().
at line 393
static array
formatUFFields(array $groupArr, array $fieldArrs, bool $visibility = NULL, bool $searchable = NULL, bool $showAll = FALSE, null $ctype = NULL, int $permissionType = CRM_Core_Permission::CREATE)
Format a list of UFFields for use with buildProfile. This is the in-memory analog of getFields().
at line 442
static protected array
formatUFField(CRM_Core_DAO_UFGroup|CRM_Core_DAO $group, CRM_Core_DAO_UFField|CRM_Core_DAO $field, array $customFields, array $addressCustomFields, array $importableFields, int $permissionType = CRM_Core_Permission::CREATE)
Prepare a field for rendering with CRM_Core_BAO_UFGroup::buildProfile.
at line 566
static protected string
createUFFieldQuery(int $groupId, bool $searchable, bool $showAll, int $visibility, string $orderBy)
Create a query to find all visible UFFields in a UFGroup.
This is the SQL-variant of checkUFFieldDisplayable().
at line 613
static protected bool
filterUFField(CRM_Core_DAO_UFField|CRM_Core_DAO $field, bool $searchable, bool $showAll, int $visibility)
Create a query to find all visible UFFields in a UFGroup.
This is the PHP in-memory variant of createUFFieldQuery().
at line 660
static protected array
getImportableFields($showAll, $profileType, $contactActivityProfile, bool $filterMode = TRUE)
deprecated
deprecated
Get a list of filtered field metadata.
at line 698
static protected array
getProfileFieldMetadata(bool $isIncludeInactive)
Get the metadata for all potential profile fields.
at line 707
static array
getLocationFields()
Get the fields relating to locations.
at line 736
static protected mixed
getCustomFields($ctype)
at line 768
static bool
isValid(int $userID, string $name, bool $register = FALSE, int $action = NULL)
Check the data validity.
at line 819
static string
getEditHTML(int $userID, string $title, int $action = NULL, bool $register = FALSE, bool $reset = FALSE, int $profileID = NULL, bool $doNotProcess = FALSE, null $ctype = NULL)
Get the html for the form that represents this particular group.
at line 973
static null|array
getValues(int $cid, array $fields, array $values, bool $searchable = TRUE, array $componentWhere = NULL, bool $absolute = FALSE, null $additionalWhereClause = NULL)
Given a contact id and a field set, return the values from the db.
at line 1389
static bool
usedByModule(int $id)
Check if profile Group used by any module.
at line 1414
static bool
del(int $id)
Delete the profile Group.
at line 1446
static object
add(array $params, array $ids = array())
Add the UF Group.
at line 1494
static
createUFJoin(array $params, int $ufGroupId)
Make uf join entries for an uf group.
at line 1568
static array
getUFJoinRecord(int $ufGroupId = NULL, int $displayName = NULL, int $status = NULL)
Get the UF Join records for an ufgroup id.
at line 1612
static CRM_Core_BAO_UFJoin
addUFJoin(array $params)
Function takes an associative array and creates a ufjoin record for ufgroup.
at line 1625
static
delUFJoin(array $params)
Delete the uf join record for an uf group.
at line 1640
static int
getWeight(int $ufGroupId = NULL)
Get the weight for ufjoin record.
at line 1676
static array
getModuleUFGroup(string $moduleName = NULL, int $count, bool $skipPermission = TRUE, int $op = CRM_Core_Permission::VIEW, array|NULL $returnFields = NULL)
Get the uf group for a module.
at line 1744
static bool
filterUFGroups(int $ufGroupId, int $contactID = NULL)
Filter ufgroups based on logged in user contact type.
at line 1793
static null
buildProfile(CRM_Core_Form $form, array $field, int $mode, int $contactId = NULL, bool $online = FALSE, string $usedFor = NULL, int $rowNumber = NULL, string $prefix = '')
Add profile field to a form.
at line 2305
static
setProfileDefaults(int $contactId, array $fields, array $defaults, bool $singleProfile = TRUE, int $componentId = NULL, null $component = NULL)
Set profile defaults.
at line 2533
static array
getProfiles(array $types, bool $onlyPure = FALSE)
Get profiles by type eg: pure Individual etc
at line 2563
static array
getValidProfiles(array $required, array $optional = NULL)
Check whether a profile is valid combination of required and/or optional profile types
at line 2595
static array
checkValidProfile(array $ufId, array $required = NULL)
Check whether a profile is valid combination of required profile fields
at line 2635
static array
setRegisterDefaults(array $fields, array $defaults)
Get default value for Register.
at line 2661
static CRM_Core_DAO
copy(int $id)
make a copy of a profile, including all the fields in the profile
at line 2728
static
commonSendMail(int $contactID, array $values)
Process that send notification e-mails
at line 2789
array
checkFieldsEmptyValues(int $gid, int $cid, array $params, bool $skipCheck = FALSE)
Given a contact id and a group id, returns the field values from the db for this group and notify email only if group's notify field is set and field values are not empty
at line 2821
static
profileDisplay(int $gid, array $values, CRM_Core_Smarty $template)
Assign uf fields to template.
at line 2839
static array
formatFields(array $params, int $contactId = NULL)
Format fields for dupe Contact Matching.
at line 2974
static array
calculateGroupType(int $gId, bool $includeTypeValues = FALSE, int $ignoreFieldId = NULL)
Calculate the profile type 'group_type' as per profile fields.
at line 2991
static array
_calculateGroupType($ufFields, bool $includeTypeValues = FALSE, int $ignoreFieldId = NULL)
Calculate the profile type 'group_type' as per profile fields.
at line 3060
static bool
updateGroupTypes(int $gId, array $groupTypes = array())
Update the profile type 'group_type' as per profile fields including group types and group subtype values.
Build and store string like: group_type1,group_type2[VALUE_SEPERATOR]group_type1Type:1:2:3,group_type2Type:1:2
FIELDS GROUP_TYPE BirthDate + Email Individual,Contact BirthDate + Subject Individual,Activity BirthDate + Subject + SurveyOnlyField Individual,Activity\0ActivityType:28 BirthDate + Subject + SurveyOnlyField + PhoneOnlyField (Not allowed) BirthDate + SurveyOnlyField Individual,Activity\0ActivityType:28 BirthDate + Subject + SurveyOrPhoneField Individual,Activity\0ActivityType:2:28 BirthDate + SurveyOrPhoneField Individual,Activity\0ActivityType:2:28 BirthDate + SurveyOrPhoneField + SurveyOnlyField Individual,Activity\0ActivityType:2:28 BirthDate + StudentField + Subject + SurveyOnlyField Individual,Activity,Student\0ActivityType:28
at line 3133
static string
encodeGroupType(array $coreTypes, array $subTypes, string $delim = CRM_Core_DAO::VALUE_SEPARATOR)
Create a "group_type" string.
at line 3164
static
setComponentDefaults(array $fields, int $componentId, string $component, array $defaults, bool $isStandalone = FALSE)
setDefault componet specific profile fields.
at line 3300
static array
getCreateLinks(array|string $profiles = '', array $appendProfiles = array())
at line 3344
static array
profileGroups(int $profileID)
Retrieve groups of profiles.
at line 3366
static array
getDoubleOptInGroupIds(array $params, int $contactId = NULL)
Alter contact params by filtering existing subscribed groups and returns unsubscribed groups array for subscription.
at line 3440
static bool
checkForMixProfiles(array $profileIds)
Check if we are rendering mixed profiles.
at line 3490
static bool
showOverlayProfile()
Determine of we show overlay profile or not.
at line 3517
static array
groupTypeValues(int $profileId, string $groupType = NULL)
Get group type values of the profile.
at line 3559
static bool|object
isProfileDoubleOptin()
at line 3571
static bool|object
isProfileAddToGroupDoubleOptin()
at line 3586
static array
getBatchProfiles()
Get profiles used for batch entry.
at line 3606
static array|null
shiftMultiRecordFields($source, $destination, bool $returnMultiSummaryFields = FALSE)
at line 3632
static
reformatProfileFields(array $fields)
This is function is used to format pseudo fields.