dataObjectHelper = $dataObjectHelper; $this->countryDataFactory = $countryDataFactory; } protected function _construct() { $this->_init(\MSP\TwoFactorAuth\Model\ResourceModel\Country::class); } /** * Retrieve Country model * * @return \MSP\TwoFactorAuth\Api\Data\CountryInterface */ public function getDataModel() { $countryData = $this->getData(); /** @var \MSP\TwoFactorAuth\Api\Data\CountryInterface $countryDataObject */ $countryDataObject = $this->countryDataFactory->create(); $this->dataObjectHelper->populateWithArray( $countryDataObject, $countryData, \MSP\TwoFactorAuth\Api\Data\CountryInterface::class ); $countryDataObject->setId($this->getId()); return $countryDataObject; } }