| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Core_BAO_Location extends CRM_Core_DAO {
/**
- * Location block element array
+ * Location block element array.
*/
static $blocks = array('phone', 'email', 'im', 'openid', 'address');
/**
- * Create various elements of location block
+ * Create various elements of location block.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
}
/**
- * Creates the entry in the civicrm_loc_block
+ * Creates the entry in the civicrm_loc_block.
*/
public static function createLocBlock(&$location, &$entityElements) {
$locId = self::findExisting($entityElements);
'phone',
'email',
'im',
- 'address'
+ 'address',
) as $loc) {
$locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL;
$locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL;
}
/**
- * Takes an entity array and finds the existing location block
+ * Takes an entity array and finds the existing location block.
*/
public static function findExisting($entityElements) {
$eid = $entityElements['entity_id'];
}
/**
- * Takes an associative array and adds location block
+ * Takes an associative array and adds location block.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
}
/**
- * Delete the Location Block
+ * Delete the Location Block.
*
* @param int $locBlockId
* Id of the Location Block.
}
/**
- * Check if there is data to create the object
+ * Check if there is data to create the object.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return boolean
+ * @return bool
*/
public static function dataExists(&$params) {
// return if no data present
}
/**
- * Delete all the block associated with the location
+ * Delete all the block associated with the location.
*
* @param int $contactId
* Contact id.
'IM',
'Phone',
'Address',
- 'OpenID'
+ 'OpenID',
) as $block) {
$name = strtolower($block);
if (array_key_exists($name, $primaryLocBlockIds) &&
}
return $elements;
}
+
}