/** * Delete the object records that are associated with this location * * @param int $locationId id of the location to delete * * @return void * @access public * @static */ function deleteLocationBlocks($locationId) { foreach ($GLOBALS['_CRM_CORE_BAO_LOCATION']['blocks'] as $name) { require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Core_DAO_" . $name) . ".php"; eval('$object =& new CRM_Core_DAO_' . $name . '( );'); $object->location_id = $locationId; $object->delete(); } CRM_Core_BAO_Email::deleteLocation($locationId); }