| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @param array $params
* (reference) an assoc array of name/value pairs.
*
- * @return CRM_Core_DAO_CustomGroup object
- * @static
+ * @return CRM_Core_DAO_CustomGroup
*/
public static function create(&$params) {
// create custom group dao, populate fields and then save.
$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 .
* @param array $defaults
* (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Core_DAO_CustomGroup object
- * @static
+ * @return CRM_Core_DAO_CustomGroup
*/
public static function retrieve(&$params, &$defaults) {
return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomGroup', $params, $defaults);
*
* @param int $id
* Id of the database record.
- * @param bool $is_activeValue we want to set the is_active field.
+ * @param bool $is_active
* Value we want to set the is_active field.
*
- * @return Object DAO object on sucess, null otherwise
- * @static
+ * @return Object
+ * DAO object on sucess, null otherwise
*/
public static function setIsActive($id, $is_active) {
// reset the cache
$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)) {
* @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
*
- * @static
*/
public static function &getTree(
$entityType,
}
$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) {
*
* @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 = "
* @param string $query
* @param array $includedTables
* Tables to include - required because the function (for historical reasons).
- * iterates through the group tree
+ * iterates through the group tree
*/
static public function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables) {
$dao = CRM_Core_DAO::executeQuery($query);
'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);
* @param int $id
* Id of group.
*
- * @return string title
- *
- * @static
+ * @return string
+ * title
*
*/
public static function getTitle($id) {
*
* @param null $inSelector
*
- * @return array $groupTree - array consisting of all group and field details
+ * @return array
+ * array consisting of all group and field details
*
*
- * @static
*/
public static function &getGroupDetail($groupId = NULL, $searchable = NULL, &$extends = NULL, $inSelector = NULL) {
// create a new tree
* @param string $entityType
* What entity are we extending here ?.
*
- * @return string $tableName
+ * @return string
*
- * @static
*
* @see _apachesolr_civiAttachments_dereference_file_parent
*/
* Add the whereAdd clause for the DAO depending on the type of entity
* the custom group is extending.
*
- * @param $customGroupDAO
+ * @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
*
- * @static
*/
private static function _addWhereAdd(&$customGroupDAO, $entityType, $entityID = NULL, $allSubtypes = FALSE) {
$addSubtypeClause = FALSE;
* @param bool $force
* 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.
- *
- * @static
- *
+ * @return bool
+ * false if field exists for this group, true if group gets deleted.
*/
public static function deleteGroup($group, $force = FALSE) {
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;
* Prefix for custom grouptree assigned to template.
*
* @return void
- * @static
*/
public static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '') {
$form->assign_by_ref("{$prefix}groupTree", $groupTree);
* The type of custom group we are using.
*
* @return array
- * @static
*/
public static function extractGetParams(&$form, $type) {
if (empty($_GET)) {
* @param array $removeCustomFieldTypes
* Remove custom fields of a type eg: array("Individual") ;.
*
- *
- * @return boolean false if it matches else true
- * @static
+ * @return bool
+ * false if it matches else true
*/
public static function checkCustomField($customFieldId, &$removeCustomFieldTypes) {
$query = "SELECT cg.extends as extends
* 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 object $form
*
- * @return array $formattedGroupTree
+ * @return array
*/
public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) {
$formattedGroupTree = array();
* @param CRM_Core_Form $form
* Page object.
* @param array $groupTree
- * Associated array.
* @param bool $returnCount
* True if customValue count needs to be returned.
* @param int $gID
* @param array $values
* Associated array of custom values.
* @param array $field
- * Associated array.
* @param bool $dncOptionPerLine
* True if optionPerLine should not be consider.
*
//changed isset CRM-4601
if (CRM_Utils_System::isNull($value)) {
- return;
+ return NULL;
}
$htmlType = CRM_Utils_Array::value('html_type', $field);
* @param array $fieldIds
* Array of custom field ids.
*
- * @return array $groupLabels - array consisting of groups and fields labels with ids.
+ * @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();
* @param int $gID
* Custom group id.
*
- * @return boolean true if empty otherwise false.
+ * @return bool|NULL
+ * true if empty otherwise false.
*/
public static function isGroupEmpty($gID) {
if (!$gID) {
- return;
+ return NULL;
}
$tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup',
* @param array $types
* Var which should have the list appended.
*
- * @return array of types.
+ * @return array
+ * Array of types.
*/
public static function getExtendedObjectTypes(&$types = array()) {
static $flag = FALSE, $objTypes = array();
}
return $multipleGroup;
}
+
}