| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
namespace Civi\API\Provider;
public function __construct($apiKernel) {
$this->apiKernel = $apiKernel;
$this->actions = array(
- // FIXME: We really need to deal with the api's lack of uniformity wrt
- // case (Entity or entity).
'Entity' => array('get', 'getactions'),
- 'entity' => array('get', 'getactions'),
'*' => array('getactions'), // 'getfields'
);
}
/**
* {inheritdoc}
+ * @param array $apiRequest
+ * @return array
+ * @throws \API_Exception
*/
public function invoke($apiRequest) {
if (strtolower($apiRequest['entity']) == 'entity' && $apiRequest['action'] == 'get') {
/**
* {inheritdoc}
+ * @param int $version
+ * @return array
*/
public function getEntityNames($version) {
return array('Entity');
/**
* {inheritdoc}
+ * @param int $version
+ * @param string $entity
+ * @return array
*/
public function getActionNames($version, $entity) {
$entity = _civicrm_api_get_camel_name($entity, $version);
return isset($this->actions[$entity]) ? $this->actions[$entity] : $this->actions['*'];
}
+
}