| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Contact_BAO_ContactType extends CRM_Contact_DAO_ContactType {
/**
- * Fetch object based on array of properties
+ * Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
}
/**
- * Get a list of elements for select box
+ * Get a list of elements for select box.
* Note that this used to default to using the hex(01) character - which results in an invalid character being used in form fields
* which was not handled well be anything that loaded & resaved the html (outside core)
* The use of this separator is now explicit in the calling functions as a step towards it's removal
*
* @return mixed
*/
- static function getSelectElements(
+ public static function getSelectElements(
$all = FALSE,
$isSeparator = TRUE,
$separator = '__'
}
/**
- * Check if a given type is a subtype
+ * Check if a given type is a subtype.
*
* @param string $subType
* Contact subType.
* @param bool $ignoreCache
*
- * @return boolean
+ * @return bool
* true if subType, false otherwise.
*/
public static function isaSubType($subType, $ignoreCache = FALSE) {
* @param bool $ignoreCache
* @param string $columnName
*
- * @return boolean
+ * @return bool
* true if contact extends, false otherwise.
*/
public static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') {
}
/**
- * Create shortcuts menu for contactTypes
+ * Create shortcuts menu for contactTypes.
*
* @return array
* of contactTypes
}
/**
- * Delete Contact SubTypes
+ * Delete Contact SubTypes.
*
* @param int $contactTypeId
* ID of the Contact Subtype to be deleted.
}
/**
- * Add or update Contact SubTypes
+ * Add or update Contact SubTypes.
*
* @param array $params
* An assoc array of name/value pairs.
*
- * @return object
+ * @return object|void
*/
public static function add(&$params) {
// label or name
if (empty($params['id']) && empty($params['label'])) {
- return;
+ return NULL;
}
if (!empty($params['parent_id']) &&
!CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_ContactType', $params['parent_id'])
) {
- return;
+ return NULL;
}
$contactType = new CRM_Contact_DAO_ContactType();
}
/**
- * Update the is_active flag in the db
+ * Update the is_active flag in the db.
*
* @param int $id
* Id of the database record.
* @param string $subType
* Subtype.
*
- * @return boolean
+ * @return bool
*/
public static function isAllowEdit($contactId, $subType = NULL) {
}
/**
- * Function that does something
+ * Function that does something.
* @todo what does this function do?
*
* @param int $contactID
*
* @return bool
*/
- static function deleteCustomSetForSubtypeMigration(
+ public static function deleteCustomSetForSubtypeMigration(
$contactID,
$contactType,
$oldSubtypeSet = array(),
$query = "DELETE FROM {$customTable} WHERE entity_id = %1";
return CRM_Core_DAO::singleValueQuery($query, array(1 => array($entityID, 'Integer')));
}
+
}