<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.6 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ * @package CiviCRM_APIv3
+ */
/**
* Get information about fields for a given api request.
}
}
}
- $entity = _civicrm_api_get_camel_name($apiRequest['entity']);
- $lcase_entity = _civicrm_api_get_entity_name_from_camel($entity);
+ $entity = $apiRequest['entity'];
+ $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity);
$subentity = CRM_Utils_Array::value('contact_type', $apiRequest['params']);
- $action = strtolower(CRM_Utils_Array::value('action', $apiRequest['params']));
+ $action = CRM_Utils_Array::value('action', $apiRequest['params']);
$sequential = empty($apiRequest['params']) ? 0 : 1;
$apiOptions = CRM_Utils_Array::value('options', $apiRequest['params'], array());
if (!$action || $action == 'getvalue' || $action == 'getcount') {
if (empty($metadata['id'])) {
// if id is not set we will set it eg. 'id' from 'case_id', case_id will be an alias
if (!empty($metadata[strtolower($apiRequest['entity']) . '_id'])) {
- $metadata['id'] = $metadata[$lcase_entity . '_id'];
- unset($metadata[$lcase_entity . '_id']);
- $metadata['id']['api.aliases'] = array($lcase_entity . '_id');
+ $metadata['id'] = $metadata[$lowercase_entity . '_id'];
+ unset($metadata[$lowercase_entity . '_id']);
+ $metadata['id']['api.aliases'] = array($lowercase_entity . '_id');
}
}
else {
// (note) or setting for all api where fields is returning 'id' & we want to accept 'note_id' @ the api layer
// nb we don't officially accept note_id anyway - rationale here is more about centralising a now-tested
// inconsistency
- $metadata['id']['api.aliases'] = array($lcase_entity . '_id');
+ $metadata['id']['api.aliases'] = array($lowercase_entity . '_id');
}
break;
'title' => $entity . ' ID',
'name' => 'id',
'api.required' => 1,
- 'api.aliases' => array($lcase_entity . '_id'),
+ 'api.aliases' => array($lowercase_entity . '_id'),
'type' => CRM_Utils_Type::T_INT,
));
break;