<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
*
* This function is invoked from within the web form layer and also from the api layer
*
- * @param array $params (reference) an assoc array of name/value pairs
+ * @param array $params
+ * (reference) an assoc array of name/value pairs.
*
- * @return CRM_Core_DAO_CustomGroup object
- * @access public
- * @static
+ * @return CRM_Core_DAO_CustomGroup
*/
- static function create(&$params) {
+ public static function create(&$params) {
// create custom group dao, populate fields and then save.
$group = new CRM_Core_DAO_CustomGroup();
$group->title = $params['title'];
$params['extends'][0] == 'ParticipantEventName' ||
$params['extends'][0] == 'ParticipantEventType'
) {
- $group->extends_entity_column_id =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $params['extends'][0], 'value', 'name');
+ $group->extends_entity_column_id = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $params['extends'][0], 'value', 'name');
}
//this is format when form get submit.
$extendsChildType = implode(CRM_Core_DAO::VALUE_SEPARATOR, $extendsChildType);
if (CRM_Utils_Array::value(0, $params['extends']) == 'Relationship') {
$extendsChildType = str_replace(array('_a_b', '_b_a'), array(
- '',
- ''
- ), $extendsChildType);
+ '',
+ '',
+ ), $extendsChildType);
}
if (substr($extendsChildType, 0, 1) != CRM_Core_DAO::VALUE_SEPARATOR) {
$extendsChildType = CRM_Core_DAO::VALUE_SEPARATOR . $extendsChildType .
'help_pre',
'help_post',
'is_active',
- 'is_multiple'
+ 'is_multiple',
);
foreach ($fields as $field) {
$group->$field = CRM_Utils_Array::value($field, $params, FALSE);
/**
* Fetch object based on array of properties
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Core_DAO_CustomGroup object
- * @access public
- * @static
+ * @return CRM_Core_DAO_CustomGroup
*/
- static function retrieve(&$params, &$defaults) {
+ public static function retrieve(&$params, &$defaults) {
return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $params, $defaults);
}
/**
* Update the is_active flag in the db
*
- * @param int $id id of the database record
- * @param boolean $is_active value we want to set the is_active field
+ * @param int $id
+ * Id of the database record.
+ * @param bool $is_active
+ * Value we want to set the is_active field.
*
- * @return Object DAO object on sucess, null otherwise
- * @static
- * @access public
+ * @return Object
+ * DAO object on sucess, null otherwise
*/
- static function setIsActive($id, $is_active) {
+ public static function setIsActive($id, $is_active) {
// reset the cache
CRM_Core_BAO_Cache::deleteGroup('contact fields');
/**
* Determine if given entity (sub)type has any custom groups
*
- * @param string $extends e.g. "Individual", "Activity"
- * @param int $columnId e.g. custom-group matching mechanism (usu NULL for matching on sub type-id); see extends_entity_column_id
- * @param string $columnValue e.g. "Student" or "3" or "3\05"; see extends_entity_column_value
+ * @param string $extends
+ * E.g. "Individual", "Activity".
+ * @param int $columnId
+ * E.g. custom-group matching mechanism (usu NULL for matching on sub type-id); see extends_entity_column_id.
+ * @param string $columnValue
+ * E.g. "Student" or "3" or "3\05"; see extends_entity_column_value.
*
* @return bool
*/
$dao = new CRM_Core_DAO_CustomGroup();
$dao->extends = $extends;
$dao->extends_entity_column_id = $columnId;
- $escapedValue =
- CRM_Core_DAO::VALUE_SEPARATOR . CRM_Core_DAO::escapeString($columnValue) .
- CRM_Core_DAO::VALUE_SEPARATOR;
+ $escapedValue = CRM_Core_DAO::VALUE_SEPARATOR . CRM_Core_DAO::escapeString($columnValue) . CRM_Core_DAO::VALUE_SEPARATOR;
$dao->whereAdd("extends_entity_column_value LIKE \"%$escapedValue%\"");
//$dao->extends_entity_column_value = $columnValue;
return $dao->find() ? TRUE : FALSE;
*
* @param int $activityTypeId
*
- * @return bool TRUE if a group is found or created; FALSE on error
+ * @return bool
+ * TRUE if a group is found or created; FALSE on error
*/
public static function autoCreateByActivityType($activityTypeId) {
if (self::hasCustomGroup('Activity', NULL, $activityTypeId)) {
*
* An array containing all custom groups and their custom fields is returned.
*
- * @param string $entityType - of the contact whose contact type is needed
- * @param CRM_Core_Form $form - not used but required
+ * @param string $entityType
+ * Of the contact whose contact type is needed.
+ * @param CRM_Core_Form $form
+ * Not used but required.
* @param int $entityID
* @param int $groupID
* @param string $subType
* @param bool $fromCache
* @param bool $onlySubType
*
- * @return array $groupTree - array The returned array is keyed by group id and has the custom group table fields
- * and a subkey 'fields' holding the specific custom fields.
- * If entityId is passed in the fields keys have a subkey 'customValue' which holds custom data
- * if set for the given entity. This is structured as an array of values with each one having the keys 'id', 'data'
+ * @return array
+ * The returned array is keyed by group id and has the custom group table fields
+ * and a subkey 'fields' holding the specific custom fields.
+ * If entityId is passed in the fields keys have a subkey 'customValue' which holds custom data
+ * if set for the given entity. This is structured as an array of values with each one having the keys 'id', 'data'
*
* @todo - review this - It also returns an array called 'info' with tables, select, from, where keys
- * The reason for the info array in unclear and it could be determined from parsing the group tree after creation
- * With caching the performance impact would be small & the function would be cleaner
+ * The reason for the info array in unclear and it could be determined from parsing the group tree after creation
+ * With caching the performance impact would be small & the function would be cleaner
*
- * @access public
- *
- * @static
*/
public static function &getTree(
$entityType,
'date_format',
'time_format',
'option_group_id',
- 'in_selector'
+ 'in_selector',
),
'civicrm_custom_group' => array(
'id',
}
$cacheKey = "CRM_Core_DAO_CustomGroup_Query " . md5($cacheString);
- $multipleFieldGroupCacheKey =
- "CRM_Core_DAO_CustomGroup_QueryMultipleFields " . md5($cacheString);
+ $multipleFieldGroupCacheKey = "CRM_Core_DAO_CustomGroup_QueryMultipleFields " . md5($cacheString);
$cache = CRM_Utils_Cache::singleton();
$tablesWithEntityData = array();
if ($fromCache) {
$groupTree['info']['from'][] = $table;
$select = array(
"{$table}.id as {$table}_id",
- "{$table}.entity_id as {$table}_entity_id"
+ "{$table}.entity_id as {$table}_entity_id",
);
foreach ($fields as $column => $dontCare) {
$select[] = "{$table}.{$column} as {$table}_{$column}";
* Check whether the custom group has any data for the given entity.
*
*
- * @param integer $entityID id of entity for whom we are checking data for
- * @param string $table table that we are checking
+ * @param int $entityID
+ * Id of entity for whom we are checking data for.
+ * @param string $table
+ * Table that we are checking.
*
* @param bool $getCount
*
- * @return boolean does this entity have data in this custom table
+ * @return bool
+ * does this entity have data in this custom table
*/
static public function customGroupDataExistsForEntity($entityID, $table, $getCount = FALSE) {
$query = "
* multiple fields. These now have a new behaviour (one at a time) but the single fields still use this
* mechanism as it seemed to be acceptable in this context
*
- * @param array $groupTree (reference) group tree array which is being built
- * @param integer $entityID id of entity for whom the tree is being build up.
- * @param array $entitySingleSelectClauses array of select clauses relevant to the entity
- * @param array $singleFieldTablesWithEntityData array of tables in which this entity has data
+ * @param array $groupTree
+ * (reference) group tree array which is being built.
+ * @param int $entityID
+ * Id of entity for whom the tree is being build up.
+ * @param array $entitySingleSelectClauses
+ * Array of select clauses relevant to the entity.
+ * @param array $singleFieldTablesWithEntityData
+ * Array of tables in which this entity has data.
*/
static public function buildEntityTreeSingleFields(&$groupTree, $entityID, $entitySingleSelectClauses, $singleFieldTablesWithEntityData) {
$select = implode(', ', $entitySingleSelectClauses);
*
* This is done one table at a time to avoid Cross-Joins resulting in too many rows being returned
*
- * @param array $groupTree (reference) group tree array which is being built
- * @param integer $entityID id of entity for whom the tree is being build up.
- * @param array $entityMultipleSelectClauses array of select clauses relevant to the entity
- * @param array $multipleFieldTablesWithEntityData array of tables in which this entity has data
+ * @param array $groupTree
+ * (reference) group tree array which is being built.
+ * @param int $entityID
+ * Id of entity for whom the tree is being build up.
+ * @param array $entityMultipleSelectClauses
+ * Array of select clauses relevant to the entity.
+ * @param array $multipleFieldTablesWithEntityData
+ * Array of tables in which this entity has data.
*/
static public function buildEntityTreeMultipleFields(&$groupTree, $entityID, $entityMultipleSelectClauses, $multipleFieldTablesWithEntityData) {
foreach ($entityMultipleSelectClauses as $table => $selectClauses) {
*
* This function represents shared code between the buildEntityTreeMultipleFields & the buildEntityTreeSingleFields function
*
- * @param array $groupTree (reference) group tree array which is being built
+ * @param array $groupTree
+ * (reference) group tree array which is being built.
* @param string $query
- * @param array $includedTables tables to include - required because the function (for historical reasons)
- * iterates through the group tree
+ * @param array $includedTables
+ * Tables to include - required because the function (for historical reasons).
+ * iterates through the group tree
*/
static public function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables) {
$dao = CRM_Core_DAO::executeQuery($query);
/**
* Build the entity-specific custom data into the group tree on a per-field basis
*
- * @param object $dao object representing the custom field to be populated into the groupTree
- * @param array $groupTree (reference) the group tree being build
- * @param string $table table name
- * @param unknown_type $groupID custom group ID
- * @param unknown_type $fieldID custom field ID
+ * @param object $dao
+ * Object representing the custom field to be populated into the groupTree.
+ * @param array $groupTree
+ * (reference) the group tree being build.
+ * @param string $table
+ * Table name.
+ * @param unknown_type $groupID
+ * Custom group ID.
+ * @param unknown_type $fieldID
+ * Custom field ID.
*/
static public function buildCustomFieldData($dao, &$groupTree, $table, $groupID, $fieldID) {
$column = $groupTree[$groupID]['fields'][$fieldID]['column_name'];
'name' => ts('Delete Attached File'),
'url' => 'civicrm/file',
'qs' => 'reset=1&id=%%id%%&eid=%%eid%%&fid=%%fid%%&action=delete',
- 'extra' => 'onclick = "if (confirm( \'' . $deleteExtra .
- '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
+ 'extra' => 'onclick = "if (confirm( \'' . $deleteExtra
+ . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"',
),
);
$customValue['deleteURL'] = CRM_Core_Action::formLink($deleteURL,
'entity_id',
'file_id'
);
- $customValue['imageURL'] =
- str_replace('persist/contribute', 'custom', $config->imageUploadURL) .
+ $customValue['imageURL'] = str_replace('persist/contribute', 'custom', $config->imageUploadURL) .
$fileDAO->uri;
- list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId,
- NULL, NULL
- );
+ list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId, NULL, NULL);
if ($path && file_exists($path)) {
list($imageWidth, $imageHeight) = getimagesize($path);
list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
/**
* Get the group title.
*
- * @param int $id id of group.
- *
- * @return string title
+ * @param int $id
+ * Id of group.
*
- * @access public
- * @static
+ * @return string
+ * title
*
*/
public static function getTitle($id) {
*
* An array containing custom group details (including their custom field) is returned.
*
- * @param int $groupId - group id whose details are needed
- * @param boolean $searchable - is this field searchable
- * @param array $extends - which table does it extend if any
+ * @param int $groupId
+ * Group id whose details are needed.
+ * @param bool $searchable
+ * Is this field searchable.
+ * @param array $extends
+ * Which table does it extend if any.
*
* @param null $inSelector
*
- * @return array $groupTree - array consisting of all group and field details
+ * @return array
+ * array consisting of all group and field details
*
- * @access public
*
- * @static
*/
public static function &getGroupDetail($groupId = NULL, $searchable = NULL, &$extends = NULL, $inSelector = NULL) {
// create a new tree
* currently if entity type is 'Contact', 'Individual', 'Household', 'Organization'
* tableName is 'civicrm_contact'
*
- * @param string $entityType what entity are we extending here ?
+ * @param string $entityType
+ * What entity are we extending here ?.
*
- * @return string $tableName
+ * @return string
*
- * @access public
- * @static
*
* @see _apachesolr_civiAttachments_dereference_file_parent
*/
case 'Group':
$tableName = 'civicrm_group';
break;
+
// DRAFTING: Verify if we cannot make it pluggable
case 'Activity':
case 'Grant':
$tableName = 'civicrm_grant';
break;
+
// need to add cases for Location, Address
}
* If there are custom-groups which only apply to certain subtypes,
* those WILL be included.
*
- * @param $entityType string
+ * @param string $entityType
*
* @return CRM_Core_DAO_CustomGroup
*/
- static function getAllCustomGroupsByBaseEntity($entityType) {
+ public static function getAllCustomGroupsByBaseEntity($entityType) {
$customGroupDAO = new CRM_Core_DAO_CustomGroup();
self::_addWhereAdd($customGroupDAO, $entityType, NULL, TRUE);
return $customGroupDAO;
* Add the whereAdd clause for the DAO depending on the type of entity
* the custom group is extending.
*
- * @param $customGroupDAO
- * @param string $entityType - what entity are we extending here ?
+ * @param object $customGroupDAO
+ * @param string $entityType
+ * What entity are we extending here ?.
*
- * @param object CRM_Core_DAO_CustomGroup (reference) - Custom Group DAO.
+ * @param int $entityID
* @param bool $allSubtypes
*
* @return void
*
- * @access private
- * @static
*/
private static function _addWhereAdd(&$customGroupDAO, $entityType, $entityID = NULL, $allSubtypes = FALSE) {
$addSubtypeClause = FALSE;
/**
* Delete the Custom Group.
*
- * @param $group object the DAO custom group object
- * @param $force boolean whether to force the deletion, even if there are custom fields
- *
- * @return boolean false if field exists for this group, true if group gets deleted.
- *
- * @access public
- * @static
+ * @param $group
+ * Object the DAO custom group object.
+ * @param bool $force
+ * whether to force the deletion, even if there are custom fields.
*
+ * @return bool
+ * false if field exists for this group, true if group gets deleted.
*/
public static function deleteGroup($group, $force = FALSE) {
* @param bool $inactiveNeeded
* @param int $action
*/
- static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $inactiveNeeded = FALSE, $action = CRM_Core_Action::NONE) {
+ public static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $inactiveNeeded = FALSE, $action = CRM_Core_Action::NONE) {
foreach ($groupTree as $id => $group) {
if (!isset($group['fields'])) {
continue;
* @param array $params
* @param bool $skipFile
*/
- static function postProcess(&$groupTree, &$params, $skipFile = FALSE) {
+ public static function postProcess(&$groupTree, &$params, $skipFile = FALSE) {
// Get the Custom form values and groupTree
// first reset all checkbox and radio data
foreach ($groupTree as $groupID => $group) {
}
}
-
if (!isset($groupTree[$groupID]['fields'][$fieldId]['customValue'])) {
// field exists in db so populate value from "form".
$groupTree[$groupID]['fields'][$fieldId]['customValue'] = array();
case 'CheckBox':
if (!empty($v)) {
$customValue = array_keys($v);
- $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] =
- CRM_Core_DAO::VALUE_SEPARATOR .
- implode(CRM_Core_DAO::VALUE_SEPARATOR, $customValue) .
- CRM_Core_DAO::VALUE_SEPARATOR;
+ $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR
+ . implode(CRM_Core_DAO::VALUE_SEPARATOR, $customValue)
+ . CRM_Core_DAO::VALUE_SEPARATOR;
}
else {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = NULL;
//added for Multi-Select
case 'Multi-Select':
if (!empty($v)) {
- $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] =
- CRM_Core_DAO::VALUE_SEPARATOR .
- implode(CRM_Core_DAO::VALUE_SEPARATOR, $v) .
- CRM_Core_DAO::VALUE_SEPARATOR;
+ $groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = CRM_Core_DAO::VALUE_SEPARATOR
+ . implode(CRM_Core_DAO::VALUE_SEPARATOR, $v)
+ . CRM_Core_DAO::VALUE_SEPARATOR;
}
else {
$groupTree[$groupID]['fields'][$fieldId]['customValue']['data'] = NULL;
/**
* Generic function to build all the form elements for a specific group tree
*
- * @param CRM_Core_Form $form the form object
- * @param array $groupTree the group tree object
- * @param boolean $inactiveNeeded return inactive custom groups
- * @param string $prefix prefix for custom grouptree assigned to template
+ * @param CRM_Core_Form $form
+ * The form object.
+ * @param array $groupTree
+ * The group tree object.
+ * @param bool $inactiveNeeded
+ * Return inactive custom groups.
+ * @param string $prefix
+ * Prefix for custom grouptree assigned to template.
*
* @return void
- * @access public
- * @static
*/
- static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') {
+ public static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') {
$form->assign_by_ref("{$prefix}groupTree", $groupTree);
// this is fix for date field
* Extract the get params from the url, validate
* and store it in session
*
- * @param CRM_Core_Form $form the form object
- * @param string $type the type of custom group we are using
+ * @param CRM_Core_Form $form
+ * The form object.
+ * @param string $type
+ * The type of custom group we are using.
*
* @return array
- * @access public
- * @static
*/
- static function extractGetParams(&$form, $type) {
+ public static function extractGetParams(&$form, $type) {
if (empty($_GET)) {
return array();
}
'Multi-Select',
'AdvMulti-Select',
'Select',
- 'Radio'
+ 'Radio',
);
foreach ($groupTree as $group) {
* Check the type of custom field type (eg: Used for Individual, Contribution, etc)
* this function is used to get the custom fields of a type (eg: Used for Individual, Contribution, etc )
*
- * @param int $customFieldId custom field id
- * @param array $removeCustomFieldTypes remove custom fields of a type eg: array("Individual") ;
- *
+ * @param int $customFieldId
+ * Custom field id.
+ * @param array $removeCustomFieldTypes
+ * Remove custom fields of a type eg: array("Individual") ;.
*
- * @return boolean false if it matches else true
- * @static
- * @access public
+ * @return bool
+ * false if it matches else true
*/
- static function checkCustomField($customFieldId, &$removeCustomFieldTypes) {
+ public static function checkCustomField($customFieldId, &$removeCustomFieldTypes) {
$query = "SELECT cg.extends as extends
FROM civicrm_custom_group as cg, civicrm_custom_field as cf
WHERE cg.id = cf.custom_group_id
* @return string
* @throws Exception
*/
- static function mapTableName($table) {
+ public static function mapTableName($table) {
switch ($table) {
case 'Contact':
case 'Individual':
/**
* @param $group
*/
- static function createTable($group) {
+ public static function createTable($group) {
$params = array(
'name' => $group->table_name,
'is_multiple' => $group->is_multiple ? 1 : 0,
/**
* Function returns formatted groupTree, sothat form can be easily build in template
*
- * @param array $groupTree associated array
- * @param int $groupCount group count by default 1, but can varry for multiple value custom data
- * @param object form object
+ * @param array $groupTree
+ * @param int $groupCount
+ * Group count by default 1, but can varry for multiple value custom data.
+ * @param object $form
*
- * @return array $formattedGroupTree
+ * @return array
*/
- static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) {
+ public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) {
$formattedGroupTree = array();
$uploadNames = array();
/**
* Build custom data view
*
- * @param CRM_Core_Form $form page object
- * @param array $groupTree associated array
- * @param boolean $returnCount true if customValue count needs to be returned
+ * @param CRM_Core_Form $form
+ * Page object.
+ * @param array $groupTree
+ * @param bool $returnCount
+ * True if customValue count needs to be returned.
* @param int $gID
* @param null $prefix
* @param int $customValueId
*
* @return array|int
*/
- static function buildCustomDataView(&$form, &$groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL) {
+ public static function buildCustomDataView(&$form, &$groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL) {
$details = array();
foreach ($groupTree as $key => $group) {
if ($key === 'info') {
/**
* Format custom value according to data, view mode
*
- * @param array $values associated array of custom values
- * @param array $field associated array
- * @param boolean $dncOptionPerLine true if optionPerLine should not be consider
+ * @param array $values
+ * Associated array of custom values.
+ * @param array $field
+ * @param bool $dncOptionPerLine
+ * True if optionPerLine should not be consider.
*
* @return array|null|string
*/
- static function formatCustomValues(&$values, &$field, $dncOptionPerLine = FALSE) {
+ public static function formatCustomValues(&$values, &$field, $dncOptionPerLine = FALSE) {
$value = $values['data'];
//changed isset CRM-4601
if (CRM_Utils_System::isNull($value)) {
- return;
+ return NULL;
}
$htmlType = CRM_Utils_Array::value('html_type', $field);
'dd-mm' => "%E%f %B $customTimeFormat",
'yy' => "%Y $customTimeFormat",
'M yy' => "%b %Y $customTimeFormat",
- 'yy-mm' => "%Y-%m $customTimeFormat"
+ 'yy-mm' => "%Y-%m $customTimeFormat",
);
if ($format = CRM_Utils_Array::value('date_format', $field)) {
$retValue = $value;
break;
}
- // note that if its not text / textarea, the code falls thru and executes
- // the below case also
+ // note that if its not text / textarea, the code falls thru and executes
+ // the below case also
case 'StateProvince':
case 'Country':
$options = array();
/**
* Get the custom group titles by custom field ids.
*
- * @param array $fieldIds - array of custom field ids.
+ * @param array $fieldIds
+ * Array of custom field ids.
*
- * @return array $groupLabels - array consisting of groups and fields labels with ids.
- * @access public
+ * @return array|NULL
+ * array consisting of groups and fields labels with ids.
*/
public static function getGroupTitles($fieldIds) {
if (!is_array($fieldIds) && empty($fieldIds)) {
- return;
+ return NULL;
}
$groupLabels = array();
return $groupLabels;
}
- static function dropAllTables() {
+ public static function dropAllTables() {
$query = "SELECT table_name FROM civicrm_custom_group";
$dao = CRM_Core_DAO::executeQuery($query);
/**
* Check whether custom group is empty or not.
*
- * @param int $gID - custom group id.
+ * @param int $gID
+ * Custom group id.
*
- * @return boolean true if empty otherwise false.
- * @access public
+ * @return bool|NULL
+ * true if empty otherwise false.
*/
- static function isGroupEmpty($gID) {
+ public static function isGroupEmpty($gID) {
if (!$gID) {
- return;
+ return NULL;
}
$tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup',
/**
* Get the list of types for objects that a custom group extends to.
*
- * @param array $types - var which should have the list appended.
+ * @param array $types
+ * Var which should have the list appended.
*
- * @return array of types.
- * @access public
+ * @return array
+ * Array of types.
*/
- static function getExtendedObjectTypes(&$types = array()) {
+ public static function getExtendedObjectTypes(&$types = array()) {
static $flag = FALSE, $objTypes = array();
if (!$flag) {
}
list($className) = explode('::', $callback);
- require_once(str_replace('_', DIRECTORY_SEPARATOR, $className) .
- '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $className) .
+ '.php';
$objTypes[$ovValues['value']] = call_user_func_array($callback, $args);
}
*
* @return bool
*/
- static function hasReachedMaxLimit($customGroupId, $entityId) {
+ public static function hasReachedMaxLimit($customGroupId, $entityId) {
//check whether the group is multiple
$isMultiple = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'is_multiple');
$isMultiple = ($isMultiple) ? TRUE : FALSE;
/**
* @return array
*/
- static function getMultipleFieldGroup() {
+ public static function getMultipleFieldGroup() {
$multipleGroup = array();
$dao = new CRM_Core_DAO_CustomGroup();
$dao->is_multiple = 1;
}
return $multipleGroup;
}
-}
+}