<?php

namespace Benhauer\Salesmanago\UI\DataProvider;

use \Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface;
use  \Magento\Ui\DataProvider\AbstractDataProvider;

class AccountSettingsDataProvider extends AbstractDataProvider implements DataProviderInterface
{
//    public function getData()
//    {
//        return $this->searchResultToOutput($this->getSearchResult());
//    }

    public function prepareDataSource(array $dataSource) {
        return [
            'data' => [
                'config' => [
                    'componentType'=>'container',
                    'location' => '123123'
                ],
                'items' => [
                    'location' => '1231235'
                ]
            ]
        ];

//        if (isset($dataSource['data']['items'])) {
//            foreach ($dataSource['data']['items'] as &$item) {
//                $item[$this->getData('name')]['edit'] = [
//                    'href' => $this->urlBuilder->getUrl(
//                        'contacts/test/edit',
//                        ['id' => $item['pfay_contacts_id']]
//                    ),
//                    'label' => __('Edit'),
//                    'hidden' => false,
//                ];
//                $item[$this->getData('name')]['delete'] = [
//                    'href' => $this->urlBuilder->getUrl(
//                        'contacts/test/delete',
//                        ['id' => $item['pfay_contacts_id']]
//                    ),
//                    'label' => __('Delete'),
//                    'hidden' => false,
//                ];
//            }
//        }
//        return $dataSource;
    }

    public function addFilter(\Magento\Framework\Api\Filter $filter)
    {
        return;
    }
}
