if ($daoName && !$daoName::isComponentEnabled()) {
throw new \Civi\API\Exception\NotImplementedException("$entity API is not available because " . $daoName::COMPONENT . " component is disabled");
}
+ // Extra arguments used e.g. by dynamic entities like Multi-Record custom groups & the ECK extension
$args = (array) CoreUtil::getInfoItem($entity, 'class_args');
$apiRequest = call_user_func_array($callable, $args);
foreach ($params as $name => $param) {
namespace Civi\Api4\Event\Subscriber;
+use Civi\API\Request;
use Civi\Api4\Utils\CoreUtil;
use Civi\Core\Event\GenericHookEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
// Default sort order
$e->display['settings']['sort'] = self::getDefaultSort($entityName);
- $fields = CoreUtil::getApiClass($entityName)::get()->entityFields();
+ $apiGet = Request::create($entityName, 'get', ['version' => 4]);
+ $fields = $apiGet->entityFields();
$columns = [$labelField];
// Add grouping fields like "event_type_id" in the description
$grouping = (array) (CoreUtil::getCustomGroupExtends($entityName)['grouping'] ?? []);