/**
  * Function to delete location Types 
  * 
  * @param  int  $locationTypeId     ID of the location type to be deleted.
  * 
  * @access public
  * @static
  */
 static function del($locationTypeId)
 {
     $entity = array('address', 'phone', 'email', 'im');
     //check dependencies
     foreach ($entity as $key) {
         if ($key == 'im') {
             $name = strtoupper($key);
         } else {
             $name = ucfirst($key);
         }
         require_once str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Core_DAO_' . $name) . ".php";
         eval('$object = new CRM_Core_DAO_' . $name . '( );');
         $object->location_type_id = $locationTypeId;
         $object->delete();
     }
     $locationType = new CRM_Core_DAO_LocationType();
     $locationType->id = $locationTypeId;
     $locationType->delete();
 }
 /**
  * Delete a Location Type.
  *
  * @param int $locationTypeId
  */
 public function locationTypeDelete($locationTypeId)
 {
     $locationType = new CRM_Core_DAO_LocationType();
     $locationType->id = $locationTypeId;
     $locationType->delete();
 }
Example #3
0
 /**
  * Delete location Types.
  *
  * @param int $locationTypeId
  *   ID of the location type to be deleted.
  *
  */
 public static function del($locationTypeId)
 {
     $entity = array('address', 'phone', 'email', 'im');
     //check dependencies
     foreach ($entity as $key) {
         if ($key == 'im') {
             $name = strtoupper($key);
         } else {
             $name = ucfirst($key);
         }
         $baoString = 'CRM_Core_BAO_' . $name;
         $object = new $baoString();
         $object->location_type_id = $locationTypeId;
         $object->delete();
     }
     $locationType = new CRM_Core_DAO_LocationType();
     $locationType->id = $locationTypeId;
     $locationType->delete();
 }