dataObjectHelper = $dataObjectHelper; $this->trustedDataFactory = $trustedDataFactory; } protected function _construct() { $this->_init(\MSP\TwoFactorAuth\Model\ResourceModel\Trusted::class); } /** * Retrieve Trusted model * * @return \MSP\TwoFactorAuth\Api\Data\TrustedInterface */ public function getDataModel() { $trustedData = $this->getData(); /** @var \MSP\TwoFactorAuth\Api\Data\TrustedInterface $trustedDataObject */ $trustedDataObject = $this->trustedDataFactory->create(); $this->dataObjectHelper->populateWithArray( $trustedDataObject, $trustedData, \MSP\TwoFactorAuth\Api\Data\TrustedInterface::class ); $trustedDataObject->setId($this->getId()); return $trustedDataObject; } }