collection = $collectionFactory->create(); $this->dataPersistor = $dataPersistor; parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data); } /** * @inheritDoc */ public function getData() { if (isset($this->loadedData)) { return $this->loadedData; } $items = $this->collection->getItems(); foreach ($items as $model) { $this->loadedData[$model->getId()] = $model->getData(); } $data = $this->dataPersistor->get('jr_netsuite_location'); if (!empty($data)) { $model = $this->collection->getNewEmptyItem(); $model->setData($data); $this->loadedData[$model->getId()] = $model->getData(); $this->dataPersistor->clear('jr_netsuite_location'); } return $this->loadedData; } }