* @param int $id
* Group id.
*
- * @return null
+ * @return NULL
* @static
*
*/
* Which properties should be included in the returned group objects.
* (member_count should be last element.)
*
- * @param null $sort
- * @param null $offset
- * @param null $rowCount
+ * @param NULL $sort
+ * @param NULL $offset
+ * @param NULL $rowCount
*
* @return array of group objects.
*
* @param int $id
* The id of the object.
*
- * @return string the permission that the user has (or null)
+ * @return string the permission that the user has (or NULL)
* @static
*/
public static function checkPermission($id) {
* @param array $params
* Associative array of parameters.
*
- * @return object|null The new group BAO (if created)
+ * @return object|NULL The new group BAO (if created)
* @static
*/
public static function &create(&$params) {
$params['group_type'] = '';
}
- $session = CRM_Core_Session::singleton( );
+ $session = CRM_Core_Session::singleton();
$cid = $session->get('userID');
// this action is add
if ($cid && empty($params['id'])) {
// use metadata to translate the array to the appropriate DB type or altering the param in the api layer,
// or at least altering the param in same section as 'group_type' rather than repeating here. However, further down
// we need the $params one to be in it's original form & we are not sure what test coverage we have on that
- if(isset($group->parents) && is_array($group->parents)) {
+ if (isset($group->parents) && is_array($group->parents)) {
$group->parents = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
array_keys($group->parents)
) . CRM_Core_DAO::VALUE_SEPARATOR;
* @param array $params
* Associative array of parameters.
*
- * @return object|null The new group BAO (if created)
+ * @return object|NULL The new group BAO (if created)
* @static
*/
public static function createSmartGroup(&$params) {
* @param bool $isActive
* Value we want to set the is_active field.
*
- * @return Object DAO object on sucess, null otherwise
+ * @return Object DAO object on sucess, NULL otherwise
* @static
*/
public static function setIsActive($id, $isActive) {
elseif ($groupType == 'Access') {
$value = CRM_Core_DAO::VALUE_SEPARATOR . '1' . CRM_Core_DAO::VALUE_SEPARATOR;
}
- elseif (!empty($groupType)){
+ elseif (!empty($groupType)) {
// ie we have been given the group key
$value = CRM_Core_DAO::VALUE_SEPARATOR . $groupType . CRM_Core_DAO::VALUE_SEPARATOR;
}
public static function getPermissionClause($force = FALSE) {
static $clause = 1;
static $retrieved = FALSE;
- if ((!$retrieved || $force ) && !CRM_Core_Permission::check('view all contacts') && !CRM_Core_Permission::check('edit all contacts')) {
+ if ((!$retrieved || $force) && !CRM_Core_Permission::check('view all contacts') && !CRM_Core_Permission::check('edit all contacts')) {
//get the allowed groups for the current user
$groups = CRM_ACL_API::group(CRM_ACL_API::VIEW);
if (!empty($groups)) {
if (empty($params['parent_id']) && !empty($value['parents'])) {
$groupIds = explode(',', $value['parents']);
$title = array();
- foreach($groupIds as $gId) {
+ foreach ($groupIds as $gId) {
$title[] = $allGroups[$gId];
}
- $groupList[$id]['group_name'] .= '<div class="crm-row-parent-name"><em>'.ts('Child of').'</em>: ' . implode(', ', $title) . '</div>';
+ $groupList[$id]['group_name'] .= '<div class="crm-row-parent-name"><em>' . ts('Child of') . '</em>: ' . implode(', ', $title) . '</div>';
$value['class'] = array_diff($value['class'], array('crm-row-parent'));
}
$value['class'][] = 'crm-entity';
$where .= " AND status = 'Added'";
}
$dao = CRM_Core_DAO::executeQuery("SELECT group_id, COUNT(id) as `count` FROM $table WHERE $where GROUP BY group_id");
- while($dao->fetch()) {
+ while ($dao->fetch()) {
$values[$dao->group_id]['count'] = $dao->count;
}
}
* @param array $groupIDs
* Array of group ids.
*
- * @param null $parents
+ * @param NULL $parents
* @param string $spacer
* @param bool $titleOnly
*
$allGroups[$dao->id] = array(
'title' => $dao->title,
'visibility' => $dao->visibility,
- 'description' => $dao->description
+ 'description' => $dao->description,
);
if ($dao->parents == $parents) {
$roots[] = array(
'id' => $dao->id,
'prefix' => '',
- 'title' => $dao->title
+ 'title' => $dao->title,
);
}
else {
'id' => $dao->id,
'prefix' => '',
'title' => $dao->title,
- 'parents' => $parent
+ 'parents' => $parent,
);
}
}
$new_roots[] = array(
'id' => $row['id'],
'prefix' => $groups[$root['id']][0] . $spacer,
- 'title' => $row['title']
+ 'title' => $row['title'],
);
unset($rows[$key]);
}
/**
* @param array $params
*
- * @return null|string
+ * @return NULL|string
*/
public static function getGroupCount(&$params) {
$whereClause = self::whereClause($params, FALSE);