X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=api%2Fv3%2FWebsite.php;h=8ce2cfc0b2b7826c003b31499ce38000dde36c1a;hb=b0a317143b2c1a6aee3b6bc99ef31532881f652e;hp=257ee3409627250169ec74c470054bc2c6f327e2;hpb=1761553f7e28866ef0c0a9f54abbb222487cea5c;p=civicrm-core.git diff --git a/api/v3/Website.php b/api/v3/Website.php index 257ee34096..8ce2cfc0b2 100644 --- a/api/v3/Website.php +++ b/api/v3/Website.php @@ -1,5 +1,4 @@ id]); - return civicrm_api3_create_success($values, $params, 'website', 'get'); + $values = array(); + _civicrm_api3_object_to_array($websiteBAO, $values[$websiteBAO->id]); + return civicrm_api3_create_success($values, $params, 'website', 'get'); } /** - * Adjust Metadata for Create action + * Adjust Metadata for Create action. * - * The metadata is used for setting defaults, documentation & validation - * @param array $params array or parameters determined by getfields + * The metadata is used for setting defaults, documentation & validation. + * + * @param array $params + * Array of parameters determined by getfields. */ function _civicrm_api3_website_create_spec(&$params) { $params['contact_id']['api.required'] = 1; } /** - * Deletes an existing Website - * - * @param array $params - * {@getfields website_delete} - * @example WebsiteDelete.php Std Delete Example + * Deletes an existing Website. * - * @return array API result Array - * @access public * @todo convert to using Basic delete - BAO function non standard + * + * @param array $params + * + * @return array + * API result + * @throws \API_Exception */ function civicrm_api3_website_delete($params) { //DO NOT USE THIS FUNCTION AS THE BASIS FOR A NEW API http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards @@ -93,24 +85,18 @@ function civicrm_api3_website_delete($params) { } } else { - return civicrm_api3_create_error('Could not delete website with id ' . $websiteID); + throw new API_Exception('Could not delete website with id ' . $websiteID); } } /** - * Retrieve one or more websites + * Retrieve one or more websites. * - * @param mixed[] (reference ) input parameters - * {@getfields website_get} - * {@example WebsiteGet.php 0} - * @example WebsiteGet.php - * @param array $params an associative array of name/value pairs. - * - * @return array details of found websites + * @param array $params * - * @access public + * @return array + * details of found websites */ function civicrm_api3_website_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'website'); } -