src/Event/Model/WidgetsListener.php
private function getSavedSearchWidgets(): array
    {
        $table = TableRegistry::get('Search.SavedSearches');

        $query = $table->find('all')
            ->where([
                'SavedSearches.name IS NOT' => null,
                'SavedSearches.name !=' => '',
                'SavedSearches.system' => false
            ])
            ->enableHydration(false)
            ->indexBy('id');

        if ($query->isEmpty()) {
            return [];
        }

        return [
            ['type' => 'saved_search', 'data' => $query->toArray()]
        ];
    }
private function getSavedSearchWidgets(): array
    {
        $table = TableRegistry::get('Search.SavedSearches');

        $query = $table->find('all')
            ->where([
                'SavedSearches.name IS NOT' => null,
                'SavedSearches.name !=' => '',
                'SavedSearches.system' => false
            ])
            ->enableHydration(false)
            ->indexBy('id');

        if ($query->isEmpty()) {
            return [];
        }

        return [
            ['type' => 'saved_search', 'data' => $query->toArray()]
        ];
    }
private function getSavedSearchWidgets ( ) : array { $ table = TableRegistry :: get ( 'Search.SavedSearches' ) ; $ query = $ table -> find ( 'all' ) -> where ( [ 'SavedSearches.name IS NOT' => null , 'SavedSearches.name !=' => '' , 'SavedSearches.system' => false ] ) -> enableHydration ( false ) -> indexBy ( 'id' ) ; if ( $ query -> isEmpty ( ) ) { return [ ] ; } return [ [ 'type' => 'saved_search' , 'data' => $ query -> toArray ( ) ] ] ; }
Fetch all saved searches from the database.

@return mixed[]
Fetch all saved searches from the database .