<?php
-// $Id$
/*
+--------------------------------------------------------------------+
* @version $Id: Phone.php 2011-03-16 ErikHommel $
*/
-/**
- * Include utility functions
- */
-require_once 'CRM/Core/BAO/Phone.php';
-
/**
* Add an Phone for a contact
*
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
-/*
+/**
* Adjust Metadata for Create action
- *
+ *
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
*/
* @access public
*/
function civicrm_api3_phone_delete($params) {
-
- $phoneID = CRM_Utils_Array::value('id', $params);
-
- require_once 'CRM/Core/DAO/Phone.php';
- $phoneDAO = new CRM_Core_DAO_Phone();
- $phoneDAO->id = $phoneID;
- if ($phoneDAO->find()) {
- while ($phoneDAO->fetch()) {
- $phoneDAO->delete();
- return civicrm_api3_create_success($phoneDAO->id, $params, $phoneDAO);
- }
- }
- else {
- return civicrm_api3_create_error('Could not delete phone with id ' . $phoneID);
- }
+ return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**