<?php
-use Civi\Api4\Entity;
use Civi\BAO\Import;
use CRM_Civiimport_ExtensionUtil as E;
-// Check if SearchKit is enabled before adding SavedSearches.
-try {
- if (!Entity::get(FALSE)
- ->addWhere('name', '=', 'SearchDisplay')
- ->selectRowCount()
- ->execute()->count()) {
- return [];
- }
-}
-catch (CRM_Core_Exception $e) {
- return [];
-}
-
$managedEntities = [];
$importEntities = Import::getImportTables();
foreach ($importEntities as $importEntity) {
--- /dev/null
+<?php
+
+use CRM_Civiimport_ExtensionUtil as E;
+
+return [
+ [
+ 'name' => 'SavedSearch_My_imports',
+ 'entity' => 'SavedSearch',
+ 'cleanup' => 'always',
+ 'update' => 'unmodified',
+ 'params' => [
+ 'version' => 4,
+ 'values' => [
+ 'name' => 'My_imports',
+ 'label' => E::ts('My imports'),
+ 'form_values' => NULL,
+ 'mapping_id' => NULL,
+ 'search_custom_id' => NULL,
+ 'api_entity' => 'UserJob',
+ 'api_params' => [
+ 'version' => 4,
+ 'select' => [
+ 'id',
+ 'created_date',
+ 'status_id:label',
+ 'job_type:label',
+ ],
+ 'orderBy' => [],
+ 'where' => [
+ [
+ 'created_id',
+ '=',
+ 'user_contact_id',
+ ],
+ [
+ 'is_template',
+ '=',
+ FALSE,
+ ],
+ ],
+ 'groupBy' => [],
+ 'join' => [],
+ 'having' => [],
+ ],
+ 'expires_date' => NULL,
+ 'description' => NULL,
+ ],
+ ],
+ ],
+];