4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
22 namespace Civi\Api4\Utils
;
29 * @return \Civi\Api4\Generic\AbstractAction
30 * @throws \Civi\API\Exception\NotImplementedException
32 public static function getAction($entityName, $actionName) {
33 // For custom pseudo-entities
34 if (strpos($entityName, 'Custom_') === 0) {
35 return \Civi\Api4\CustomValue
::$actionName(substr($entityName, 7));
38 $callable = ["\\Civi\\Api4\\$entityName", $actionName];
39 if (!is_callable($callable)) {
40 throw new \Civi\API\Exception\
NotImplementedException("API ($entityName, $actionName) does not exist (join the API team and implement it!)");
42 return call_user_func($callable);