X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FTag.php;h=475bb5f6ff9f83e448eeaa65899cd532ce837a96;hb=79c0e11ec92e46b36336f7903a537c5fcc78efef;hp=435cdc7e2148b8520a59207188ff2639734e6e3e;hpb=b2ac9e9ca74be7f852e37e0dfbf0e77627471c4d;p=civicrm-core.git diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 435cdc7e21..475bb5f6ff 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -44,8 +44,10 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * 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 object CRM_Core_DAO_Tag object on success, otherwise null * @static @@ -124,10 +126,11 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * * @return array */ - public static function getTagsUsedFor($usedFor = array('civicrm_contact'), + public static function getTagsUsedFor($usedFor = array( + 'civicrm_contact'), $buildSelect = TRUE, - $all = FALSE, - $parentId = NULL + $all = FALSE, + $parentId = NULL ) { $tags = array(); @@ -180,18 +183,24 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Function to retrieve tags * - * @param string $usedFor which type of tag entity - * @param array $tags tags array - * @param int $parentId parent id if you want need only children - * @param string $separator separator to indicate children - * @param boolean $formatSelectable add special property for non-selectable + * @param string $usedFor + * Which type of tag entity. + * @param array $tags + * Tags array. + * @param int $parentId + * Parent id if you want need only children. + * @param string $separator + * Separator to indicate children. + * @param bool $formatSelectable + * Add special property for non-selectable. * tag, so they cannot be selected * * @return array */ - static function getTags($usedFor = 'civicrm_contact', + static function getTags( + $usedFor = 'civicrm_contact', &$tags = array(), - $parentId = NULL, + $parentId = NULL, $separator = '  ', $formatSelectable = FALSE ) { @@ -295,7 +304,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { $formattedTags = array(); foreach ($tags as $key => $tag) { if (!empty($tag[2])) { - $key = $tag[2]. "-" . $key; + $key = $tag[2] . "-" . $key; } $formattedTags[$key] = $tag[0] . $tag[1]; } @@ -307,7 +316,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Delete the tag * - * @param int $id tag id + * @param int $id + * Tag id. * * @return boolean * @static @@ -343,8 +353,10 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * contact object. the params array could contain additional unused name/value * pairs * - * @param array $params (reference) an assoc array of name/value pairs - * @param array $ids (optional) the array that holds all the db ids - we are moving away from this in bao + * @param array $params + * (reference) an assoc array of name/value pairs. + * @param array $ids + * (optional) the array that holds all the db ids - we are moving away from this in bao. * signatures * * @return object CRM_Core_DAO_Tag object on success, otherwise null @@ -382,7 +394,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { // if we modify parent tag, then we need to update all children if ($tag->parent_id === 'null') { CRM_Core_DAO::executeQuery("UPDATE civicrm_tag SET used_for=%1 WHERE parent_id = %2", - array(1 => array($params['used_for'], 'String'), + array( + 1 => array($params['used_for'], 'String'), 2 => array($tag->id, 'Integer'), ) ); @@ -394,7 +407,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Check if there is data to create the object * - * @param array $params (reference ) an assoc array of name/value pairs + * @param array $params + * (reference ) an assoc array of name/value pairs. * * @return boolean * @static @@ -412,7 +426,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Get the tag sets for a entity object * - * @param string $entityTable entity_table + * @param string $entityTable + * Entity_table. * * @return array $tagSets array of tag sets * @static @@ -432,7 +447,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { /** * Get the tags that are not children of a tagset. * - * @return array $tags associated array of tag name and id@access public + * @return array $tags associated array of tag name and id + * @access public * @static */ public static function getTagsNotInTagset() {